-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support relative references #977
Comments
When importing a file the editor has no idea of the original location of the file on your filesystem: this is a limit of the browser to protect your files. |
What about letting the user specify the relative root location on a local filesystem, can that be done? |
An app running in a browser can't access files on a local filesystem. Game over. |
Could we import the referenced files ourselves? Ie have an 'import references' feature where we select the referenced files and then the editor uses that when it sees a |
We're using Sway which uses JSON Refs for resolving JSON Pointers. JSON Refs is using Path Loader for loading URLs.
If we override origin and base path for each request in Here is an example:
root:
$ref: './a.yaml'
a:
$ref: '../b.yaml'
foo: bar Lets say
My plan is to add an option to preferences for the base URL of resolving |
You can try this feature in http://editor.swagger.io now |
Is it not possible to import your entire swagger folder to accomplish the same result? Say you have your swagger folder containing:
(possibly subdirectories also) And import that in your swagger editor. Wouldn't that allow you to resolve the references in the same way they are resolved in your application (node for instance)? |
Hi, |
We decided to just build our swagger file from partials on startup. We do the names like this so that we can only watch the .yml files for changes with nodemon and also so that our main swagger.yaml builder ignores the swagger.yaml file itself. Hope this helps. |
Please add support for relative references to other files. E.g. if I have an API split into multiple files in my working location:
... and I want the two API files to relatively refer to the common structures, e.g.:
$ref: MyCommonStructures.yaml#YadaYada
It would be very convenient to be able to work in the editor with these relative references so that user doesn't need to find/create some mechanism to host the files at some absolute location.
Some possible ideas:
The text was updated successfully, but these errors were encountered: