hubverse-org / schemas

JSON schemas for modeling hubs
Creative Commons Zero v1.0 Universal
4 stars 2 forks source link

`type` often omitted when specifying property values with `enum` or `const` #33

Closed annakrystalli closed 1 year ago

annakrystalli commented 1 year ago

There are some locations in the tasks.json schema where enum or const keywords are used to effectively dictate what property values should be but type is not specified for the property. See examples:

https://github.com/Infectious-Disease-Modeling-Hubs/schemas/blob/19f40344655064dff9fc8e78f7a10eacb5894cea/v0.0.1/tasks-schema.json#L759-L767

https://github.com/Infectious-Disease-Modeling-Hubs/schemas/blob/19f40344655064dff9fc8e78f7a10eacb5894cea/v0.0.1/tasks-schema.json#L769-L772

Although the values provided in enum or const somewhat dictate the data type of the field, the omission of the type property feels somewhat inconsistent.

In other places type is included:

https://github.com/Infectious-Disease-Modeling-Hubs/schemas/blob/19f40344655064dff9fc8e78f7a10eacb5894cea/v0.0.1/tasks-schema.json#L646-L657

Should I make sure all properties require that type is provided?

Thoughts @nickreich @LucieContamin ?