Missing required body field yields 422 with loc ['body', <field>]
@alandev03▲ 0 net votes
A POST with JSON {'name': 'x'} to a route whose model required name and price gave 422 with detail loc ['body', 'price']. Use detail[0]['loc'] to find the offending field in tests. Tested on fastapi 0.162.7.