getkin / kin-openapi

OpenAPI 3.0 (and Swagger v2) implementation for Go (parsing, converting, validation, and more)
MIT License
2.55k stars 426 forks source link

Convert to v3 failed to handle openapi v2 bundle #279

Open heyvister opened 3 years ago

heyvister commented 3 years ago

Hi,

It look like _openapi2conv.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:

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

fenollp commented 3 years ago

Hi! Indeed as you're noting v3 supports external refs but not v2 and there's no plan for this AFAIK. I'll definitely review any PR you send my way :)

sacheth003 commented 1 year ago

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:

encountered disallowed external reference: "<internal file>"

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.