marshmallow-jsonschema
marshmallow-jsonschema copied to clipboard
JSON Schema Draft v7 (http://json-schema.org/) formatting with marshmallow
Hello! I know this is not what is done in this library. I just wanted to know if: 1. did you know of any package that does the reverse: take...
`enumNames` is not part of the JSON Schema spec, it was part of a draft but was never accepted. It is possible to get the same behaviour using a `oneOf`...
Just like the `OneOf` validator, the `ContainsOnly` validator can be used to generate a JSON schema that validates a list of items. This PR adds the `anyOf` property to the...
The `get_properties` method sorts the properties in alphabetical order. If the schema defines a `Meta` schema like the one below, the properties will most likely be in the wrong order...
Closes #117 Using a `type` of `number` and a `format` of `integer` is not documented in the [JSON schema specification]( https://json-schema.org/understanding-json-schema/reference/numeric.html?highlight=integer#integer) as a correct way to represent integers. Instead, a...
I specified the model as: ``` class TestRoleSchema(db_schema.SQLAlchemyAutoSchema): class Meta: model = Role ``` If I have the datetime field, the result JSON will be: ``` created: format: "date-time" title:...
Fixes #121 and removes `"type": "object"` from referenced schemas
``` class ChildSchema(Schema): id = fields.Integer(required=True) class TestSchema(Schema): id = fields.Integer(required=True) nested_fld = fields.Nested(ChildSchema, allow_none=True) schema = TestSchema() dumped = validate_and_dump(schema) ``` should result on a schema that allows the...
If I have the following: `class mySchema(Schema): id = Int(allow_none=True) ` `JSONSchema().dump(mySchema)` will return `'id': {'title': 'id', 'type': 'number', 'format': 'integer'}` but will not specify that it can be None....
When allow_none is set to True in the marshmallow schema, we have to add 'null' to the list of possible types. Other wise you get a None is not a...