Problem
Sending an invalid JSON body to the quote endpoint returns
400 instead of 422. The OpenAPI spec defines 422 as the
correct status code for unparseable JSON bodies.
Impact
Low — does not block core functionality but causes confusion
for SDK clients and integrators who follow the OpenAPI spec
to handle errors correctly.
To reproduce
- POST https://api.cow.fi/sepolia/api/v1/quote
- Header: Content-Type: application/json
- Body: {broken json
- Observe 400 Bad Request
Expected behaviour
Status: 422
Per OpenAPI spec:
422 → Unable to parse request body as valid JSON
Actual behaviour
Status: 400 Bad Request
Content-Type: text/plain; charset=utf-8
Body: Failed to parse the request body as JSON:
key must be a string at line 1 column 2
Screenshots/logs
See attached Postman screenshot showing the 400 response.
services version/commit hash and environment
Version: v2.362.3-dirty
Environment: production (https://api.cow.fi/sepolia)
Additional context
Reference: https://docs.cow.fi/cow-protocol/reference/apis/orderbook
Problem
Sending an invalid JSON body to the quote endpoint returns
400 instead of 422. The OpenAPI spec defines 422 as the
correct status code for unparseable JSON bodies.
Impact
Low — does not block core functionality but causes confusion
for SDK clients and integrators who follow the OpenAPI spec
to handle errors correctly.
To reproduce
Expected behaviour
Status: 422
Per OpenAPI spec:
422 → Unable to parse request body as valid JSON
Actual behaviour
Status: 400 Bad Request
Content-Type: text/plain; charset=utf-8
Body: Failed to parse the request body as JSON:
key must be a string at line 1 column 2
Screenshots/logs
See attached Postman screenshot showing the 400 response.
services version/commit hash and environment
Version: v2.362.3-dirty
Environment: production (https://api.cow.fi/sepolia)
Additional context
Reference: https://docs.cow.fi/cow-protocol/reference/apis/orderbook