json-schema-org / vocab-idl

Help and clarify how JSON Schema can be interpreted from validation rules to data definition. This extends to how those data definitions can be represented in any programming language
19 stars 4 forks source link

Built-in types #45

Open gregsdennis opened 1 year ago

gregsdennis commented 1 year ago

I think the best option is to leave association between JSON Schema constructs and built-in types to the implementation.

The implementation would have to define rules to recognized specific patterns which can map to types defined by their language.

We may be able to suggest several simplistic ones, like {"type": "integer"} maps to the 32-bit integer type, if there is one, but I don't know that JSON Schema will be able to specify more than that.

jdesrosiers commented 1 year ago

I agree that this should be implementation-defined. format can be used to hint at a type that should be used and I expect an idl vocabulary would introduce additional formats such as i32, f64, etc for this purpose. OpenAPI has some like this in their format registry.