Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Schema version? #13

Open
delaneyj opened this issue Apr 29, 2022 · 1 comment
Open

JSON Schema version? #13

delaneyj opened this issue Apr 29, 2022 · 1 comment

Comments

@delaneyj
Copy link

I'd like to enable auto completion tooling in VSCode. Do you know if there is a JSON Schema DraftV7 version of the JTD definition? I know it seems like at odd ask but would make editing and validating schema in an IDE on a team much easier.

I had started one but then thought I'd reach out first

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$comment": "A JSON Schema for a JSON Type Definition RFC 8927",
  "title": "JSON Type Definition",
  "definitions": {
    "empty": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "type": {
      "type": "object",
      "properties": {
        "type": {
          "enum": [
            "boolean",
            "string",
            "timestamp",
            "float32",
            "float64",
            "int8",
            "uint8",
            "int16",
            "uint16",
            "int32",
            "uint32"
          ]
        }
      },
      "required": ["properties"],
      "additionalProperties": false
    },
    "enum": {
      "type": "object",
      "properties": {
        "enum": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "required": ["enum"],
      "additionalProperties": false
    },
    "elements": {
      "type": "object",
      "properties": {
        "elements": { "$ref": "#/definitions/schema" }
      },
      "required": ["elements"],
      "additionalProperties": false
    },
    "properties": {
      "type": "object",
      "properties": {
        "properties": {
          "type": "object",
          "additionalProperties": { "$ref": "#/definitions/schema" }
        },
        "optionalProperties": {
          "type": "object",
          "additionalProperties": { "$ref": "#/definitions/schema" }
        },
        "additionalProperties": { "type": "boolean", "default": false }
      },
      "required": ["properties"],
      "additionalProperties": false
    },
    "values": {
      "type": "object",
      "properties": {
        "values": { "$ref": "#/definitions/schema" }
      },
      "required": ["values"],
      "additionalProperties": false
    },
    "discriminator": {
      "type": "object",
      "properties": {
        "discriminator": {
          "type": "string"
        },
        "mapping": {
          "type": "object",
          "additionalProperties": { "$ref": "#/definitions/schema" }
        }
      },
      "required": ["discriminator", "mapping"],
      "additionalProperties": false
    },
    "ref": {
      "type": "object",
      "properties": {
        "ref": { "type": "string" }
      },
      "required": ["ref"],
      "additionalProperties": false
    },
    "schema": {
      "oneOf": [
        { "$ref": "#/definitions/empty" },
        { "$ref": "#/definitions/type" },
        { "$ref": "#/definitions/enum" },
        { "$ref": "#/definitions/elements" },
        { "$ref": "#/definitions/properties" },
        { "$ref": "#/definitions/values" },
        { "$ref": "#/definitions/discriminator" },
        { "$ref": "#/definitions/ref" }
      ]
    }
  },

  "type": "object",
  "properties": {
    "definitions": {
      "type": "object",
      "additionalProperties": { "$ref": "#/definitions/schema" }
    }
  },
  "additionalProperties": {
    "$ref": "#/definitions/schema"
  }
}
@ucarion
Copy link
Contributor

ucarion commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants