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

Add "-" and "_" for path binding variable names format #180

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

zsoci
Copy link
Contributor

@zsoci zsoci commented Mar 12, 2024

Our API specification comes in a yaml file containing OpenAPI definitions. We generate our trails definitions from these yaml file. Openapi does not restrict the naming of path parameters, it shall be a string without /?#. (see https://spec.openapis.org/oas/latest.html#path-templating). Our customers started to use '-' in path parameter field names. We would avoid to parse and generate field names for bindings in our handlers for cowboy. Cowboy and trails works fine with the 'extension' our swagger page generated from the trails definitions does not work as it compiles "/customers/[:customer-name]" to "/customers/{customer}-name" and cannot be used to test the endpoint from the generated swagger page.

@paulo-ferraz-oliveira
Copy link
Collaborator

@zsoci, could you maybe edit your initial message to state the motivation and use case for this? Doesn't need to be anything super-detailed or long, as long as it can serve as an historical reference. Thanks. (meanwhile, I've approved the CI run and will look closer at the implementation)

Copy link
Collaborator

@paulo-ferraz-oliveira paulo-ferraz-oliveira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, albeit a small change was proposed.

Co-authored-by: Paulo F. Oliveira <[email protected]>
@paulo-ferraz-oliveira paulo-ferraz-oliveira merged commit 944b3a6 into inaka:master Mar 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants