Closed cykoder closed 1 year ago
These changes don't yet make the schema syntax json-schema compatible due to the presence of types like stringReversible
, decimalNumber
, etc. Was the intention only to change the syntax to include type: object/array
and properties/items
in this PR?
will our schemas always work with any other jsonshema validator? no will most jsonschemas work (from types like string, integer etc) with this system eventually? yes
the intent was so that the syntax was the same, even if we support our own types. where we can support jsonschema types, we should. we already leverage jsonschemas in certs/the api and will do even more so in the future. its so that jsonschema should work for this schema system, but this schema system wont work with jsonschema (without custom type validation). as much as id love for it to just be jsonschema alone, from our conversions that isnt possible due to it not supporting all type values we have and their needed properties
however where possible id like to try keep compatibility, such as in how to define objects, arrays and basic types such as string/int/numbers. syntax is compatible, but types are not. id say they are different things. with this change i can use an existing dock certs schema just fine
i have planned to look at and see if we can introduce some other changes - such as decimalNumber
being replaced with number
as an example (to match jsonschema) - figured better to do in another PR once this is accepted to prevent more merge conflicts and more focused discussion/review around that instead of the general structural syntax change