fuhrysteve / marshmallow-jsonschema

JSON Schema Draft v7 (http://json-schema.org/) formatting with marshmallow
MIT License
209 stars 72 forks source link

Allow passing nested schemas as instances #74

Closed atmo closed 5 years ago

atmo commented 5 years ago

This allows passing nested schema instances like this:

    class TestNestedSchema(Schema):
        baz = fields.Integer()

    class TestSchema(Schema):
        foo = fields.String()
        bar = fields.Nested(TestNestedSchema())

    schema = TestSchema()
    json_schema = JSONSchema()

    print(json_schema.dump(schema))

Fixes #18

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.06%) to 98.113% when pulling 21a764da3148ced3cafdf5ac3add4e9de872640b on atmo:nested_schema_instances into c51c6fdae00c09a9d2cdace5d1f5cfdbc88ae552 on fuhrysteve:master.

fuhrysteve commented 5 years ago

Looks about right to me! Thanks for the pull!