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
Converting definitions to components isn't supporting external references. Meaning, ToV3Ref is looking for v2 prefix instead of verifies whether v2 ref contains #/definitions (i.e v2 $ref: "./common.yaml#/definitions/someScheme" cannot be converted to v3 $ref: "./common.yaml#/components/schemas/someScheme"
External v2 references are expected to be v3, as sl.ResolveRefsIn(result, &URL) is used in ToV3Swagger. So I guess there should be a mechanism which tracks all v2 externa reference files (i.e parameters.yaml), and converts them to v3, prior to resolving v2 root openapi (i.e swagger.yaml) references.
I guess that there are more issues needs to be resolved here, is this already a known issue? (couldn't find it under all open issues)
Is there a plan to fix it?
Thanks
The text was updated successfully, but these errors were encountered:
Hey @fenollp, I just wanted to confirm whether your message was still the case. For example, I am seeing the following error when converting between a v2.T to a v3.T:
Any recommended workarounds here if this is not supported? I'd imagine it would involve converting the base file to a v3 format, and then reading the new file with this library.
Hi,
It look like openapi2_conv.go fails to support openapi v2 bundle conversion.
I didn't succeed converting the following v2 bundle example:
https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v2.0/yaml/petstore-separate
Seems like there are several issues which needs to be fixed:
sl := openapi3.NewSwaggerLoader()
@ToV3Swagger()
isn't exposingIsExternalRefsAllowed
, so code is returns"encountered non-allowed external reference"
error.ToV3Ref
is looking for v2 prefix instead of verifies whether v2 ref contains #/definitions (i.e v2$ref: "./common.yaml#/definitions/someScheme"
cannot be converted to v3$ref: "./common.yaml#/components/schemas/someScheme"
sl.ResolveRefsIn(result, &URL)
is used inToV3Swagger
. So I guess there should be a mechanism which tracks all v2 externa reference files (i.e parameters.yaml), and converts them to v3, prior to resolving v2 root openapi (i.e swagger.yaml) references.I guess that there are more issues needs to be resolved here, is this already a known issue? (couldn't find it under all open issues)
Is there a plan to fix it?
Thanks
The text was updated successfully, but these errors were encountered: