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

$ref escape characters do not work as per the openapi spec when resolving #364

Closed
jwgcooke opened this issue Sep 4, 2019 · 3 comments
Closed

Comments

@jwgcooke
Copy link

jwgcooke commented Sep 4, 2019

Detailed description

This appears to be a bug in the resolve function.
As per the docs here:
https://swagger.io/docs/specification/using-ref/
the only 2 things that should be escaped in a $ref are "~" and "/". When I execute a resolve paths that include path params escape the curly braces as well and I end up with refs that looks like :
- $ref: "#/paths/1blah1%7BblahId%7D/put/parameters/1"
- $ref: "#/paths/1blah1%7BblahId%7D/put/parameters/2"
Note the %7B and %7D in the paths which should still be "{" and "}" respectively

Context

Why is this change important to you? How would you use it?
This is a bug and causes imports into other utilities of the fully resolved yaml to fail (postman specifically)
How can it benefit other users?

Possible implementation

N/A

Your environment

Include as many relevant details about the environment you experienced the bug in and how to reproduce it.

  • Node Version:
  • Operating system and version (e.g. Ubuntu 16.04, Windows 7):
  • Link to your project:
  • ...
  • ...
@MikeRalphson
Copy link
Contributor

This is not a bug in oas-kit (Speccy's resolver). See OAI/OpenAPI-Specification#1677

@jwgcooke
Copy link
Author

jwgcooke commented Sep 6, 2019

Thanks for the update @MikeRalphson. It looks like Postman does not handle this correctly and I have opened an issue with them referencing OAI/OpenAPI-Specification#1677. Based on what you point to here this can probably be closed out as speccy is functioning consistent with the spec.

@MikeRalphson
Copy link
Contributor

Thanks.

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

2 participants