Kong / go-apiops

Kong's Go based APIOps library
Apache License 2.0
19 stars 10 forks source link

deck file openapi2kong broken for swagger 2.0 #212

Open battlebyte opened 9 hours ago

battlebyte commented 9 hours ago

As of version 1.39.5 deck file openapi2kong fails to process swagger 2.0 specifications. This was working in 1.39.4 and prior. This is still broken in 1.40.3.

The error reported is:

2024/10/09 10:40:16 "msg"="error while building v3 document model \n" "error"="unable to build openapi document, supplied spec is a different version (oas2). Try 'BuildV2Model()'"
Error: failed converting OpenAPI spec 'petstore.yaml'; cannot create v3 model from document: 1 errors reported

(Tested using https://raw.githubusercontent.com/OAI/OpenAPI-Specification/refs/heads/main/examples/v2.0/yaml/petstore-expanded.yaml)

mheap commented 9 hours ago

We recently switched OpenAPI processing library to support OpenAPI 3.1. A side effect of this is that v2 no longer works.

Swagger (v2) was not officially supported by the tool, and so is not covered by backwards compatibility guarantees. If you'd like to submit a PR to make v2 work once again we can review, with the caveat that v2 is still not officially supported.