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

[tests]: equivalent path templates are created #8

Open
MikeRalphson opened this issue Aug 21, 2020 · 2 comments
Open

[tests]: equivalent path templates are created #8

MikeRalphson opened this issue Aug 21, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@MikeRalphson
Copy link

Not an easy one to solve. Shows up in the fastly fixture where pathItem keys end either {name} or {old_name}. If you replace each path template section with {0}, {1}, {2} etc and compare the resultant keys, duplicates are found.

A relative path to an individual endpoint. The field name MUST begin with a forward slash (/). The path is appended (no relative URL resolution) to the expanded URL from the Server Object's url field in order to construct the full URL. Path templating is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical

Some tools (cough) append a dummy fragment id to disambiguate equivalent pathItem keys.

@kevinswiber
Copy link
Owner

This is something we can actually detect while parsing. My initial thought was to emit a warning that it exists. Is it more surprising to have an auto-fix or to prompt for manual post-processing?

@MikeRalphson
Copy link
Author

I think you're right, maybe a warning. In APIs.guru we have an extension x-hasEquivalentPaths (https://github.com/APIs-guru/openapi-directory/wiki/specification-extensions#x-hasequivalentpaths) which we use to tag the output of other converters (like Google discovery format) to indicate we can suppress the validation error if needed.

@kevinswiber kevinswiber added the enhancement New feature or request label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants