The OpenAPI spec for GET /v1/customer/{id} declares the 200 body as $ref: '#/components/schemas/Customer' — a bare row. The controller actually returns:
```json
{
"message": "Successfully retrieved the customer with CustomerId N",
"customer": { ... },
"customers": { ... }
}
```
The dual key (customer singular + customers plural backward-compat wart) is documented in customercontroller.js's findAndRespond. SDK generators reading the spec build a client expecting the bare row, then fail to find fields at runtime because they live one level deeper.
Also: the controller emits 404 on a missing row but the spec doesn't document that response, so SDK code-gen has no branch for it.
Fix: update the spec to describe the envelope shape + add the 404 entry. Pin both with a test.
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/
The OpenAPI spec for
GET /v1/customer/{id}declares the 200 body as$ref: '#/components/schemas/Customer'— a bare row. The controller actually returns:```json
{
"message": "Successfully retrieved the customer with CustomerId N",
"customer": { ... },
"customers": { ... }
}
```
The dual key (
customersingular +customersplural backward-compat wart) is documented incustomercontroller.js'sfindAndRespond. SDK generators reading the spec build a client expecting the bare row, then fail to find fields at runtime because they live one level deeper.Also: the controller emits 404 on a missing row but the spec doesn't document that response, so SDK code-gen has no branch for it.
Fix: update the spec to describe the envelope shape + add the 404 entry. Pin both with a test.
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/