-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Steps to reproduce
Checkout https://github.com/strongloop/loopback4-example-shopping/tree/bug/include-relations.
Run npm t, it will fail with: Error: expected 200 "OK", got 422 "Unprocessable Entity".
Now, change getModelSchemaRef(Order, {includeRelations: true}) to getModelSchemaRef(Order) in order.controllers.ts. Run npm t again, test will pass now.
Apparent Cause
The actual schema of NewUserRequest model is being overwritten by its parent model User, hence the request body becomes unprocessable as the User model does not have a password property.
Acceptance Criteia
- Fix the bug
- Publish new package
-
npm ton https://github.com/strongloop/loopback4-example-shopping/tree/bug/include-relations should pass with the updated package.