@@ -201,11 +201,13 @@ Currently, null values trigger an error when nullable is false and don't
201201get defaulted if a default is available. We propose to start defaulting
202202fields with null values if a default is available, or the field will be
203203removed if no default exists, but only when the openapi nullable flag is
204- missing or false. We assume that existing APIs that use nullable are
205- happy with null values. Also, people can remove the nullable attribute
206- if they want null values to start being removed. This will help
207- aligning CRDs and built-in types (there are no ways to set nullable to
208- true for built-in types).
204+ missing or false. This means that will start accepting inputs that were
205+ rejected in the past (there is code that would work with a new server
206+ but not with an old server). We assume that existing APIs that use
207+ nullable are happy with null values. Also, people can remove the
208+ nullable attribute if they want null values to start being removed. This
209+ will help aligning CRDs and built-in types (there are no ways to set
210+ nullable to true for built-in types).
209211
210212Note that we still consider ` {} ` (and 0, 0.0, "", false, [ ] ) to be
211213different from ` null ` , so ` {"foo": {}} ` is different from ` {} ` or from
@@ -431,6 +433,10 @@ type Object struct {
431433}
432434```
433435
436+ Non-pointer fields that have a default must be omitEmpty. Kubebuilder
437+ and built-in defaulting generators should both prevent these from
438+ happening.
439+
434440This would generate the following OpenAPI:
435441``` yaml
436442Object :
0 commit comments