Closed zsoci closed 7 months ago
@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)
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.