-
Notifications
You must be signed in to change notification settings - Fork 96
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
Remote references for schema not working #1613
Comments
Yes, it's true. Currently we support only one file specifications. Please add an example of using this feature, then I can solve this problem faster. Did I understand correctly that you have a specification in several files and are trying to use openapi generator? |
I have the schema of the object separate from the API YAML. I created an example https://github.com/ricker-flow/openapi-demo |
So, the problem is that openapi-generator itself does not support such schema descriptions. So if you want this feature to be added, then create a ticket here: https://github.com/OpenAPITools/openapi-generator |
Seems it has been an open issue for 6 years OpenAPITools/openapi-generator#1123 |
@ricker-flow Sorry, that was my mistake. openapi-generator supported multiple files specifications. Problem fixed here: #1738 I tested this fix also with your sample - all works fine, but in your sample was mistke in bookinfo.json file - wrong place for required block. |
Expected Behavior
OpenAPI supports remote references for schema. Instead of reference components inside the document
$ref: '#/components/schema/Foo'
it can refer to a external files such as$ref: '../folder/foo.json'
. See https://swagger.io/docs/specification/using-ref/Actual Behaviour
Using a remote reference returns an error
Failed to get the schema name:
Steps To Reproduce
Environment Information
Example Application
https://github.com/ricker-flow/openapi-demo
Version
4.4.0
The text was updated successfully, but these errors were encountered: