Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI v3 Schema defaults cannot contain any value #11

Open
luxas opened this issue Aug 16, 2024 · 0 comments
Open

OpenAPI v3 Schema defaults cannot contain any value #11

luxas opened this issue Aug 16, 2024 · 0 comments

Comments

@luxas
Copy link

luxas commented Aug 16, 2024

Hi! 👋

Kubernetes both OpenAPI v2 and v3 side-by-side, but moving more and more towards v3, especially for CustomResourceDefinitions (CRDs). In CRDs you can specify a default value for a property.

Kubernetes has it's own meta-library kube-openapi, which has a translation layer for the OpenAPI schema. However, the proto models from this library are used.

In v2 of the proto models of this library, Schema.default is of the Any type, exactly as per the spec's There are no restrictions placed on the value of this keyword [default]..
However, in v3, this is hard-coded to only be a number, string or bool, which breaks round-tripping between JSON and protobuf in Kubernetes.

Would it be possible to support also objects and arrays in the v3 default proto encoding to be compliant with the spec?
Thanks for the consideration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant