Open felixfbecker opened 5 years ago
Not directly but we can add a custom attribute (and tell JSON.NET to deserialise but not serialise the property value).
Does the Swagger say which fields are read-only or do we need another special-case dict in the generator script?
JSON.NET seems to support this: https://stackoverflow.com/a/39380844/4208018 But I don't know about YAML.NET.
This is not exposed through OpenAPI, only mentioned in the descriptions.
Hmm, some properties downright confuse me. ContainerV1.ImagePullPolicy
says "Cannot be updated", but the linked documentation literally explains that it can be: https://kubernetes.io/docs/concepts/containers/images/#updating-images (and I would personally expect it to be updatable)
I am finding myself to write quite a few hardcoded special cases to prevent non-updatable properties from being updated. Would it be possible somehow to mark these as readonly in the field so I can introspect that instead? Do Yaml.NET and Json.NET support populating readonly fields?
This is related to #28 because there are some fields that don't have a "default value" but are populated by the system and cannot be updated, and we don't want those properties to show up in the patch either (to not be reset to their zero value). Examples:
ObjectMetaV1.Uid
,ContainerV1.TerminationMessagePolicy