kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
317 stars 205 forks source link

account for types with custom unmarshalling during default enfocement #429

Closed alexzielenski closed 11 months ago

alexzielenski commented 1 year ago

Some types have surprising defaults such as v1.Time discussed in https://github.com/kubernetes/kubernetes/issues/118771#issuecomment-1599488644.

Had further discussion about a solution and we agreed in https://github.com/kubernetes/kubernetes/issues/109427#issuecomment-1723313763 that removing implicit {} defaults for struct fields with custom type is the best way to correct the schemas.

Original fix was included in https://github.com/kubernetes/kube-openapi/pull/419#discussion_r1312056111 but split off to keep things tidy.

/cc @apelisse

apelisse commented 1 year ago

Can we have a test for this?

apelisse commented 1 year ago

We should put that on hold while we determine if we want to keep mustEnforceDefault or not.

apelisse commented 11 months ago

/lgtm /approve

k8s-ci-robot commented 11 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexzielenski, apelisse

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/kube-openapi/blob/master/OWNERS)~~ [apelisse] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment