You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have $refs to schemas, that are located in the same file with endpoint in specification. Latest release of swagger-parser incorrectly resolves responses $refs
Generated OpenAPI should contain #/components/schemas/ before MyExampleResponseRef in path schema $refs, otherwise openapi-generator can't find the schema
However, 2.1.19 release of swagger-parser puts into $refs #MyExampleResponseRef, instead of #/components/schemas/MyExampleResponseRef, if this $ref is in the same file with endpoint
[main] WARN o.o.codegen.utils.ModelUtils - Failed to get the schema name: #/ResponsesRef
[main] WARN o.o.codegen.DefaultCodegen - Error obtaining the datatype from ref: #/ResponsesRef. Default to 'object'
With previous release of swagger-parser 2.1.18 everything works correct
Seems like PR #1994 made this bug (changing this file)
Openapi-generator uses swagger-parser 2.1.19 version in latest release, so this changes breaks our code generation
I have $refs to schemas, that are located in the same file with endpoint in specification. Latest release of swagger-parser incorrectly resolves responses $refs
Generated OpenAPI should contain
#/components/schemas/
beforeMyExampleResponseRef
in path schema $refs, otherwise openapi-generator can't find the schemaHowever, 2.1.19 release of swagger-parser puts into $refs
#MyExampleResponseRef
, instead of#/components/schemas/MyExampleResponseRef
, if this $ref is in the same file with endpointExample:
My example specification:
openapi.yaml:
get.yaml:
OpenAPI output (result of
openApiParser.readLocation(...)
):OpenAPI output
As you can see above, ref to RequestBodyRef is correct, unlike ResponsesRef
And if I try to generate code with openapi-generator I got:
With previous release of swagger-parser 2.1.18 everything works correct
Seems like PR #1994 made this bug (changing this file)
Openapi-generator uses swagger-parser 2.1.19 version in latest release, so this changes breaks our code generation
My code of OpenAPI generation:
The text was updated successfully, but these errors were encountered: