I wrote a nested schema. but whenever i pass the json from postman it shows invalid input type. here is the code below:
class ChalanProductsSchema(Schema):
product_id = fields.Str(required=True)
class ChalanDetailsSchema(Schema):
chalan_id = fields.Str(required=True)
rows = fields.Nested(ChalanProductsSchema, many=True)
chalan_details_Schema = ChalanDetailsSchema(many=True)
# serializing json
data = chalan_details_Schema.load(json_data)
#json i pass from postman
{
"chalan_id":"2022.08.0002",
"rows":[
{
"product_id":"XXXXXXXX1"
},
{
"product_id":"XXXXXXXX2"
}
]
}
Error I am having:
{ "_schema": [ "Invalid input type." ] }