kcl-lang / kcl-openapi

KCL OpenAPI Integration
https://kcl-lang.io/docs/tools/cli/openapi/
Apache License 2.0
8 stars 8 forks source link

I like to have support for openapi 3.0 and 3.1 #35

Open thinkrapido opened 1 year ago

thinkrapido commented 1 year ago

I like to have support for openapi 3.0 and 3.1

Peefy commented 1 year ago

/assign @amyXia1994

amyXia1994 commented 1 year ago

Welcome @thinkrapido ! 👋 👋

In order not to block your adoption, a temporary solution could be first to convert your openapi 3.0+ spec to openapi 2.0, and then use the kcl-openapi tool to resolve it to KCL. The LucyBot api-spec-converter (online version, GitHub repo, Node.js module) can be used to do that convertion.

The initial scenario that requires conversion between openapi & KCL is based on the k8s resources, and openapi 2.0 support is enough for that. Now that KCL is aimed to be generally used for common configuration and policy scenarios, the full support of openapi is indeed necessary. I'll solve that later and welcome to contribute! Since you mentioned, could you share more information about your openapi spec and possible usage of KCL? 😃

amyXia1994 commented 1 year ago

The go-openapi lib we are adoption only supports swagger 2.0(as stated in the go-openapi readme page) and does not have clear plan to support it.

Planning to switch from go-openapi to kin-openapi

amyXia1994 commented 1 year ago

kcl-openapi should support openapi v3 since kubernetes provides v3 spec: https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec