-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[codegen] external $ref in parameters not supported #455
Comments
This should be supported as indicated in #80, can you please publish the content of your |
Please find in attachment the yaml files |
Thank you. I had to comment this section in n1MessageClass:
$ref: './TS29518_Namf_Communication.yaml#/components/schemas/N1MessageClass'
n2InformationClass:
$ref: './TS29518_Namf_Communication.yaml#/components/schemas/N2InformationClass' because the file I think this is a Swagger-Parser issue. Because with the option we are using OpenAPIParser openApiParser = new OpenAPIParser();
ParseOptions options = new ParseOptions();
options.setResolve(true);
options.setFlatten(true); The parser should merge all files in one spec with only local I will try to reproduce the issue on a smaller example. |
The problem is to be solved in Swagger-Parser. See issue: swagger-api/swagger-parser#749 |
Thank you for your analysis. |
My workaround for now:
|
The issue in Swagger-Parser was fixed, and with PR #696 OpenAPI-Generator was updated to use a version containing the fix. This issue reported here, should no longer appear with the newest |
I think it's fixed for me @jmini. But unfortunately In general, references to other files in already referenced files don't work if they are in a different folder than the spec. References are now always relative to the spec instead of the file in which they are located. |
It is fixed for me too (tested with 3.2.0). |
version 4.2.0 of the generator still produces the warning (with no external $ref) |
Might be best to open a new issue @LBoraz - afaik closed ones usually aren't being monitored |
@LBoraz did you create a new issue? |
No, i didn't |
Description
When a parameter schema $ref references an external yaml file, code generation fails.
openapi-generator version
openapi-generator-cli-3.0.3.jar
OpenAPI declaration file content or url
here is a yaml definition fragment relating to the code generation failure:
Command line used for generation
java -jar ./openapi-generator-cli-3.0.3.jar generate -i TS29510_Nnrf_NFManagement.yaml -g jaxrs-resteasy -o samples.openapi
Steps to reproduce
Output is as follows when code generation fails:
Related issues/PRs
#149
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: