Closed rafaellichen closed 1 month ago
the json schema definition:
{ "type": "object", "definitions": { "type": { "type": "string", "enum": [ "object", "boolean", "integer", "number", "string" ] }, "enum": { type: "array", uniqueItems: true, items: { type: "string" }, minItems: 1, } }, "properties": { "type": { "$ref": "#/definitions/type" }, "enum": { "$ref": "#/definitions/enum" } }, "patternProperties": { "^.*$": { "properties": { "type": { "$ref": "#/definitions/type" }, "enum": { "$ref": "#/definitions/enum" } }, "additionalProperties": { "$ref": "#" } } } }
and how i initialized the editor
const state = EditorState.create({ doc: doc, extensions: [ minimalSetup, lineNumbers(), bracketMatching(), closeBrackets(), linter(jsonParseLinter(), { delay: 0 }), lintGutter(), keymap.of([indentWithTab]), indentUnit.of(" "), json(), onUpdate, jsonSchema(...); ] })
the enum array is not being fully validated, enum: type: array and enum: minItems: 1 work, but enum: uniqueItems: true and enum: items: type: string are not being enforced.
enum: type: array
enum: minItems: 1
enum: uniqueItems: true
enum: items: type: string
ah, we don't have any tests covering patternProperties yet, let me add some and see what I get
patternProperties
thanks. confirm fixed.
the json schema definition:
and how i initialized the editor
the enum array is not being fully validated,
enum: type: array
andenum: minItems: 1
work, butenum: uniqueItems: true
andenum: items: type: string
are not being enforced.