argo-workflows icon indicating copy to clipboard operation
argo-workflows copied to clipboard

Improve schema by utilizing "additionalProperties": false

Open nakamorichi opened this issue 2 years ago • 1 comments

Summary

Many definitions are missing additionalProperties, and by default JSON Schema assumes additional properties are allowed if additionalProperties is missing. Consequently, mistyped properties are easily missed as validators considers those valid additional properties even if an object actually doesn't allow additional properties.

Basically only need to add "additionalProperties": false to each definition that doesn't permit additional properties.

Reference: https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties https://github.com/argoproj/argo-workflows/blob/master/api/jsonschema/schema.json

Use Cases

Better validation, particularly catching mistyped properties early on.


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

nakamorichi avatar May 02 '23 03:05 nakamorichi

Sounds good. Would you like to submit a PR?

terrytangyuan avatar May 03 '23 20:05 terrytangyuan