jsonsystems/json-schema

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

Closed this issue · 2 comments

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
]
}
}
}

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

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

image