implementing handling nested JSON data in Python 3.11 using Marshmallow
Quick question that's been bugging me - I've searched everywhere and can't find a clear answer. I've looked through the documentation and I'm still confused about I'm working with nested JSON data and trying to serialize and validate it using Marshmallow in Python 3.11. The JSON structure I'm dealing with looks like this: ```json { "user": { "id": 1, "name": "Alice", "address": { "street": "123 Main St", "city": "Anytown" } } } ``` I created a schema for the user and the address like this: ```python from marshmallow import Schema, fields, ValidationError class AddressSchema(Schema): street = fields.String(required=True) city = fields.String(required=True) class UserSchema(Schema): id = fields.Integer(required=True) name = fields.String(required=True) address = fields.Nested(AddressSchema) ``` When I try to load this data using the UserSchema like so: ```python user_data = { "user": { "id": 1, "name": "Alice", "address": { "street": "123 Main St", "city": "Anytown" } } } schema = UserSchema() result = schema.load(user_data['user']) ``` I encounter the following behavior: ``` marshmallow.exceptions.ValidationError: {'address': {'street': ['Missing data for required field.']}} ``` It seems like the schema is not correctly recognizing the nested structure. I've tried adjusting the `load` method to pass the entire JSON object, but then I receive another behavior about the fields not matching. I want to ensure that the validation works correctly for nested objects. What am I missing here? Is there something specific about how Marshmallow handles nested schemas that I should be aware of in this context? My development environment is Linux. Has anyone else encountered this? For context: I'm using Python on macOS. I'd really appreciate any guidance on this. Cheers for any assistance!