Skip to content

includeRelations bug #4547

@hacksparrow

Description

@hacksparrow

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions