[FR]: Support path-based $refs when resolving OpenAPI Specs
See original GitHub issueIs your feature request related to a problem? Please describe.
I’d like to use this on OpenAPI Specs that use the $ref
feature to refer to definitions from other files, such that large APIs can be split into multiple files for reuse/readability purposes.
Presently, this library only supports $refs
within the same file.
Describe the solution you’d like
Ability to use multi-file OpenAPI specs, since I’m trying to making them with https://stoplight.io/studio
Describe alternatives you’ve considered
I wonder if there are any OpenAPI tools that can rewrite a spec that uses path based $refs
such that all the content gets imported into 1 file under the “components” key, for the benefit of tools that aren’t designed to work with multi-file OpenAPI specifications such as this one.
Additional context Add any other context or screenshots about the feature request here.
- Related reading about Refs: https://swagger.io/docs/specification/using-ref/
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5
Noticed today that the latest https://www.npmjs.com/package/swagger-parser might work better than
swagger-cli
, since it’s compatible with external files, but unlike swagger-cli, supports working with circular references (which was necessary for working with recursive data types)Workaround obtained via my coworker:
swagger-cli
stitched together my files, e.g.https://www.npmjs.com/package/swagger-cli