kcl-lang/kcl-openapi

I like to have support for openapi 3.0 and 3.1

thinkrapido opened this issue ยท 4 comments

I like to have support for openapi 3.0 and 3.1

Peefy commented

/assign @amyXia1994

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? ๐Ÿ˜ƒ

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

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