Skip to content

Cleaning schemas a bit. #44

Description

@stefalce

Here are some things I didn't find cool about json schemas:

  • type Int is out of the documentation but its schema is still present.
  • little endian numbers are not in the specification docs but have schemas.
  • the datatype.json schema seems to be unused by the validator (something else may depend on it).
  • the latest version of ajv errors because strict mode isn't respected.

The strict mode error doesn't mean much except the schema has something unclear or meaningless. Validation for strict mode or not is identical. For example in the container schema there is a non necessary additionalItems which annoyingly throws an error if strict mode is on.

{
   "type":"array",
   "items":{
      "type":"object",
      "properties":{
         "anon":{
            "type":"boolean"
         },
         "name":{
            
         },
         "type":{
            "$ref":"dataType"
         }
      },
      "oneOf":[
         {
            "required":[
               "anon"
            ]
         },
         {
            "required":[
               "name"
            ]
         }
      ],
      "required":[
         "type"
      ],
      "additionalProperties":false
   },
   "additionalItems":false
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions