-
Notifications
You must be signed in to change notification settings - Fork 212
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
Validation: deserialization time vs creation time concerns #87
Comments
JSON Schema considers an object instance valid if all required properties are present (value can be OpenAPI Spec v2.0 inherits json-schema definition on My question is what's Kubernetes' concept for required field in apiserver response (e.g. some required field in resource status)? What client-side validation should be performed? |
Clients should not perform the "validation-time enforcement" actions on the results they get from apiserver, IMO. |
From client perspective (kubernetes-client/gen#52), apiserver isn't violating any rule by returning |
As far as I can see, OpenAPI 3 made it simpler by having a |
Also, conversations about client-side validation should keep in mind that some languages are more strongly-typed than Python :) My Rust codegen trusts the spec and uses |
@Arnavion That makes a lot of sense. Thanks for clarifying! |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Proto (and, it seems, json-schema) have a "required" concept, by which they mean that you cannot decode/deserialize an object that lacks the field.
Kubernetes has a required concept, by which we mean you cannot create an object if it lacks the field.
Fields that are "required" in the Kubernetes sense are NOT required in the proto/json-schema sense: There are valid uses of kubernetes resources that involve deliberately partially specified objects.
This is just an example of an attribute for which it's very important when it is checked.
I'll categorize the aspects of our system in these two buckets here, as I think of them.
Deserialization-time enforcement:
Validation-time enforcement:
The text was updated successfully, but these errors were encountered: