Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported chars in placeholder name #2207

Open
ggnaegi opened this issue Nov 19, 2024 · 7 comments
Open

Unsupported chars in placeholder name #2207

ggnaegi opened this issue Nov 19, 2024 · 7 comments
Assignees
Labels
proposal Proposal for a new functionality in Ocelot Routing Ocelot feature: Routing

Comments

@ggnaegi
Copy link
Member

ggnaegi commented Nov 19, 2024

Expected Behavior / New Feature

if "-" (hyphens) between the placeholders it should match

Actual Behavior / Motivation for New Feature

After having introduced the new solution the matching doesn't work when hyphens are found in the placeholders, eg: {"url-service-1"}

In fact, it's not possible to have hyphens as part of the regex group name, only alphanumerics and '_' (underscore) are allowed.

@ggnaegi ggnaegi self-assigned this Nov 19, 2024
@ggnaegi ggnaegi added hotfix Gitflow: Hotfix issue, PR related to hotfix branch bug Identified as a potential bug labels Nov 19, 2024
@raman-m
Copy link
Member

raman-m commented Nov 19, 2024

I will write you in Slack.
I'm sad and wondered that the quality of this feature is not the same as we thought and expected.
Please explain and attack the logs with errors!

@ggnaegi
Copy link
Member Author

ggnaegi commented Nov 19, 2024

Yes it's a sad thing because we have foreseen a lot of tests. The hyphen can't be used as regex group name caracter.

@raman-m
Copy link
Member

raman-m commented Nov 19, 2024

Please make a decision: Would you prefer to categorize this issue as a bug or convert it to a feature?

In my opinion, we do not have a bug. However, we face due to the lack of instructions in the Placeholders documentation, where we must clarify to users which characters can be used in placeholder names. Currently, we support only alphanumeric characters along with the underscore character, _. Additionally, can utilize case sensitivity in placeholder names as it is case sensitive.

@raman-m raman-m added Routing Ocelot feature: Routing and removed hotfix Gitflow: Hotfix issue, PR related to hotfix branch labels Nov 19, 2024
@raman-m raman-m changed the title Major issue with Release 23.4.0 Unsupported chars in placeholder name Nov 19, 2024
@ggnaegi
Copy link
Member Author

ggnaegi commented Nov 19, 2024

@raman-m I will have a more in-depth analysis of the situation. I think, we should first wait for more feedbacks. In my case, we have decided to use camelCasing instead.

@raman-m
Copy link
Member

raman-m commented Nov 19, 2024

In my case, we have decided to use Camel Casing instead.

Good, clever boys! In addition to camel case names, we can throw in digits and _ (underscore). These cover 99.99999999999% of developers, clients, and customers. But you, my friend, are lucky: you've got a deal with that elusive 0.0000000001% of customers! 🎉 🤣

I think, we should first wait for more feedbacks.

This issue should be opened, correct?
Additionally, should we updating the documentation to clarify allowed characters?

@raman-m raman-m added proposal Proposal for a new functionality in Ocelot and removed bug Identified as a potential bug labels Nov 19, 2024
@ggnaegi
Copy link
Member Author

ggnaegi commented Nov 19, 2024

This issue should be opened, correct? Additionally, should we updating the documentation to clarify allowed characters?

Yes and Yes

@ggnaegi
Copy link
Member Author

ggnaegi commented Nov 19, 2024

By the way, standard behavior for routing in .NET -> word with hyphens, camelCase, eg. user-id -> userId. So maybe we should follow this logic, but it's not a bug, it's a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal for a new functionality in Ocelot Routing Ocelot feature: Routing
Projects
None yet
Development

No branches or pull requests

2 participants