transform
transform copied to clipboard
JSON -> JSON Schema bug
The problem during conversion from JSON to JSON Schema draft-07 is that when passing the JSON object
{ "userId": null }
through the transformer, the output is:
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Generated schema for Root", "type": "object", "properties": { "userId": {} }, "required": [ "userId" ] }
However, the expected output is:
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Generated schema for Root", "type": "object", "properties": { "userId": { "type": "null" } }, "required": [ "userId" ] }
The issue can be reproduced here: https://transform.tools/json-to-json-schema.