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

How to handle root schemas that dont resolve to a data model #13

Open jonaslagoni opened 3 years ago

jonaslagoni commented 3 years ago

Some root schemas might not resolve to a data model such as a "class" or enum, we need to define how we want to handle such simple types.

Example schemas:

{
  "type": "string"
}
{
  "type": "array",
  "items": { "type": "string" }
}
jdesrosiers commented 3 years ago

Many language can handle this kind of thing without issue. In other languages you might need to a wrapper class of some kind to box the value.

jonaslagoni commented 3 years ago

Now that I think about it, you are right many languages handle this thing without issue, and I am not even sure this is a case we need to handle or write a test for it.

Or do you think it is needed we define it? 🤔

jdesrosiers commented 3 years ago

It's probably something we can leave up to implementations to figure out depending on what their target language supports.