Valid JSON Schema but anywhere is an issue

41 Views Asked by At

There are many libraries that generate a UI from a JSON Schema. Most of the libraries working properly. Now I have a schema that's marked by every library and online schema validator as valid. But not one library wants to generate a UI from this schema. I don't find the error. Can you help?

Here is the schema:

{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "type" : "object",
    "patternProperties" : {
      "^[0-9A-Za-z\\.-]*$": {
        "required" : [
          "USE CASE"
        ],
        "type" : "object",
        "properties" : {
          "USE CASE" : {
            "type" : "object",
            "patternProperties" : {
              "^.* (delivery|service).*$": {
                "patternProperties" : {
                  "^(EITHER|EITHER IF|IF|OR|OR IF)$": {
                    "type" : "object"
                  },
                  "^(YOU MUST|YOU MUST NOT)$": {
                    "type" : [
                      "string",
                      "array",
                      "object"
                    ]
                  }
                },
                "additionalProperties" : false
              }
            },
            "additionalProperties" : false
          },
          "COMPATIBILITY" : {
            "type" : [
              "string",
              "array"
            ]
          },
          "DEPENDING COMPATIBILITY" : {
            "type" : [
              "string",
              "array"
            ]
          },
          "INCOMPATIBILITY" : {
            "type" : [
              "string",
              "array"
            ]
          },
          "COPYLEFT CLAUSE" : {
            "type" : "string"
          },
          "PATENT HINTS" : {
            "type" : "string"
          }
        },
        "additionalProperties" : false
      }
    },
    "additionalProperties" : false
  }
1

There are 1 best solutions below

1
sandor On

It’s not valid JSON, schema url is a string and should be in quotes

"$schema": "http://json-schema.org/draft-06/schema#",