Closed znicholls closed 5 years ago
To change:
from marshmallow import Schema, fields class AssertSchema(Schema): variable = fields.String(required=True) expected = fields.Float(required=True) threshold = fields.Float() year = fields.Integer(default=2100) region = fields.String(default='GLOBAL') class TestSchema(Schema): name = fields.String(required=True) start_year = fields.Integer(default=1750) end_year = fields.Integer(default=2100) asserts = fields.Nested(AssertSchema, many=True) class CollectionSchema(Schema): base_config = fields.String(required=True) tests = fields.Nested(TestSchema, many=True) validated = CollectionSchema(strict=True).load(config)
Full details in loading section of https://marshmallow.readthedocs.io/en/3.0/quickstart.html#deserializing-objects-loading
done in various merge requests
To change: