Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FR]: Support path-based $refs when resolving OpenAPI Specs

See original GitHub issue

Is 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

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

hydrosquallcommented, Jan 29, 2020

Noticed today that the latest 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)

hydrosquallcommented, Dec 24, 2019

Workaround obtained via my coworker: swagger-cli stitched together my files, e.g.

swagger-cli bundle my_open_api_spec.yaml -t yaml > resolved_api_spec.yaml

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using $ref - Swagger
OAS 3 This guide is for OpenAPI 3.0. Using $ref. When you document an API, it is common to have some features which...
Read more >
Splitting specification file - API Handyman
Splitting a specification file will help to keep it maintainable by creating smaller files and also help to ensure consistency throughout APIs ...
Read more >
$ref is not resolved when path contains "~1" (escaped slash)
As per openapi specs ... Latest version of extension doesn't support "go to definition" if path contains ~1. Here is an example repository ......
Read more >
Step 5: The components object (OpenAPI tutorial)
The components object is unique from the other objects in the OpenAPI specification. In components, you store re-usable definitions that ...
Read more >
Resolving Overloaded Terms for API Specifications ...
API Specification — A technical standard, like OpenAPI 3.0, ... Spectral will get an — external switch and that'll support refs that hit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found