Skip to content

Hierarchy of schemata #61

@saraedum

Description

@saraedum

@DunklesArchipel and I had a discussion about inheritance of schemata.

The easiest seems to add more fields to an existing schema by doing something like this:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Extending an existing schema",
  "allOf": [
    {
      "$ref": "original-schema.json"
    },
    {
      "properties": {
        "newProperty": {
          "type": "string"
        }
      },
      "required": ["newProperty"]
    }
  ]
}

Eventually, there should be a full hierarchy of schemata that just mix and match things as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions