Closed s-knibbs closed 5 years ago
A minor issue, but when generating a schema from a dataclass that references no other dataclasses an empty definitions object is generated. This should be omitted instead. Example:
definitions
@dataclass class Point(JsonSchemaMixin): x: int y: int
Current generated schema:
{ "type": "object", "required": [ "x", "y" ], "properties": { "x": { "type": "integer" }, "y": { "type": "integer" } }, "description": "Point(x: int, y: int)", "definitions": {}, "$schema": "http://json-schema.org/draft-06/schema#" }
Expected schema:
{ "type": "object", "required": [ "x", "y" ], "properties": { "x": { "type": "integer" }, "y": { "type": "integer" } }, "description": "Point(x: int, y: int)", "$schema": "http://json-schema.org/draft-06/schema#" }
A minor issue, but when generating a schema from a dataclass that references no other dataclasses an empty
definitions
object is generated. This should be omitted instead. Example:Current generated schema:
Expected schema: