SpaceApi-archive / SchemaValidator

Bundle of SpaceApi schemas and a validator
1 stars 0 forks source link

Remove minItems for all optional fields #7

Open dbrgn opened 9 years ago

dbrgn commented 9 years ago

Optional fields like cam should not have a minItem=1 constraint.

The background for this is that we're implementing a SpaceAPI in Rust, which is statically typed. If we specify that a SpaceAPI struct contains a cam struct of a vector type, then the default serialization for it -- given that there are no cams -- is an empty list.

Alternatively we could also set the field to null by using Rust's Option<Vec<String>>, but in my eyes an empty list makes more sense. It actually communicates that there are no cams in our space.