Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Add the ability to issue warnings instead of errors for hyphens in Openapi request parameters. #2044

@armen-ch

Description

@armen-ch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions