diff --git a/test/walkers/jsonschema-draft3.json b/test/walkers/jsonschema-draft3.json new file mode 100644 index 0000000..1697c52 --- /dev/null +++ b/test/walkers/jsonschema-draft3.json @@ -0,0 +1,156 @@ +[ + { + "name": "boolean true", + "schema": true, + "trail": [ + { + "type": "jsonschema-draft3", + "path": [] + } + ] + }, + { + "name": "boolean false", + "schema": false, + "trail": [ + { + "type": "jsonschema-draft3", + "path": [] + } + ] + }, + { + "name": "https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03#section-3", + "schema": { + "$schema": "http://json-schema.org/draft-03/schema#", + "name": "Product", + "properties": { + "id": { + "type": "number", + "description": "Product identifier", + "required": true + }, + "name": { + "description": "Name of the product", + "type": "string", + "required": true + }, + "price": { + "required": true, + "type": "number", + "minimum": 0, + "required": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "links": [ + { + "rel": "full", + "href": "{id}" + }, + { + "rel": "comments", + "href": "comments/?id={id}" + } + ] + }, + "trail": [ + { + "type": "jsonschema-draft3", + "path": [] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "id" ] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "name" ] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "price" ] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "tags" ] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "tags", "items" ] + } + ] + }, + { + "name": "https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03#section-5", + "schema": { + "$schema": "http://json-schema.org/draft-03/schema#", + "description": "A person", + "type": "object", + "properties": { + "name": { "type": "string" }, + "age": { + "type": "integer", + "maximum": 125 + } + } + }, + "trail": [ + { + "type": "jsonschema-draft3", + "path": [] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "name" ] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "age" ] + } + ] + }, + { + "name": "https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03#section-5.26 (1)", + "schema": { + "$schema": "http://json-schema.org/draft-03/schema#", + "description": "An adult", + "properties": { "age": { "minimum": 21 } }, + "extends": "person" + }, + "trail": [ + { + "type": "jsonschema-draft3", + "path": [] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "age" ] + } + ] + }, + { + "name": "https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03#section-5.26 (2)", + "schema": { + "$schema": "http://json-schema.org/draft-03/schema#", + "description": "Extended schema", + "properties": { "deprecated": { "type": "boolean" } }, + "extends": "http://json-schema.org/draft-03/schema" + }, + "trail": [ + { + "type": "jsonschema-draft3", + "path": [] + }, + { + "type": "jsonschema-draft3", + "path": [ "properties", "deprecated" ] + } + ] + } +] diff --git a/walkers/jsonschema-draft3.json b/walkers/jsonschema-draft3.json index 4831600..f918e83 100644 --- a/walkers/jsonschema-draft3.json +++ b/walkers/jsonschema-draft3.json @@ -28,10 +28,5 @@ "vocabulary": "http://json-schema.org/draft-03/schema#", "type": "object", "walker": "jsonschema-draft3" - }, - "extends": { - "vocabulary": "http://json-schema.org/draft-03/schema#", - "type": "value", - "walker": "jsonschema-draft3" } }