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 the ability to issue warnings instead of errors for hyphens in Openapi request parameters. #2044

Open
armen-ch opened this issue Apr 11, 2022 · 0 comments

Comments

@armen-ch
Copy link

Is your feature request related to a problem? Please describe.

We have dozens of microservices which have parameters which contain hyphens in their names and we can't use Dredd because of this limitation.
I understand that you are trying to stick with rfc6570 and I know there have been discussions about this issue (issue #460), but it seems not many people follow this rule, on the contrary, many teams use hyphens in their API requests and it's really prevents from using Dredd for many of them.
This really makes it impossible for us to use Dredd, since it's impossible to modify all the existing APIs.

I did some research in the web and came across different articles which declare hyphen as a valid query parameter character and looks like it's widely used, e.g.
https://en.wikipedia.org/wiki/Query_string
https://developers.google.com/maps/url-encoding
https://stackoverflow.com/questions/32348875/can-hyphens-be-used-in-query-string-values
rfc3986 section-2.3

Moreover it is highly encouraged to use hyphens instead of underscores when designing URI :
Google developers advanced guidelines: url-structure
https://www.oreilly.com/library/view/restful-web-services/9780596809140/ch04.html

Describe the solution you'd like

  • Issue warnings instead of throwing errors for hyphens in Open API request parameters

Describe alternatives you've considered

  • Add ability(some parameter/config) to issue warnings instead of errors for hyphens in Open API request parameters.
  • Maybe it's better to be able to switch to warnings for a group of rules, if any similar cases?

Additional context

Swagger editor normally accepts those APIs as completely valid schemas (screenshot is attached).
Testing URL Templates Tool normally accepts those APIs as completely valid schemas.

param-with-hyphen
oasexample.zip

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

No branches or pull requests

1 participant