jsonsystems / json-schema

JSONSchema.Net Public Repository
Apache License 2.0
663 stars 64 forks source link

$id in schema generated is not uri compatible if there is space in json key #89

Closed ashudream11 closed 4 years ago

ashudream11 commented 4 years ago

sample json

{ "space in key": false }

generated schema (Issue is highlighted in schema)

{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "http://example.com/example.json", "type": "object", "title": "The root schema", "description": "The root schema comprises the entire JSON document.", "default": {}, "examples": [ { "space in key": false } ], "required": [ "space in key" ], "additionalProperties": true, "properties": { "space in key": { "$id": "#/properties/space in key", -> Issue , expected -> "$id": "#/properties/space%20in%20key", "type": "boolean", "title": "The space in key schema", "description": "An explanation about the purpose of this instance.", "default": false, "examples": [ false ] } } }

jackwootton commented 4 years ago

Thanks for reporting this. I'll ensure it's fixed in the next release. I'll leave this open for tracking purposes.

jackwootton commented 4 years ago

@ashudream11 This should now be fixed on www.jsonschema.net

image