Skip to content

OpenAPI v3 Schema defaults cannot contain any value #11

@luxas

Description

@luxas

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions