Hi loopback team !
The last publish seems to have introduced a regression.
{
"include": [
{
"relation": "relation0",
"scope": {
"include": [
{
"relation": "relation0relation0",
"scope": {
"include": [
{
"relation": "relation0relation0relation0"
}
]
}
}
]
}
},
{
"relation": "relation1"
},
{
"relation": "relation2"
}
]
}
A Bad Request 400 error :
{
"error": {
"statusCode": 400,
"name": "BadRequestError",
"message": "Invalid value.",
"details": [
{
"path": "/include/0/scope",
"code": "additionalProperties",
"message": "should NOT have additional properties",
"info": {
"additionalProperty": "include"
}
}
]
}
}
We can not use "include" inside "scope".
The queried model with all his queried relations (and relation's relations).
in progress
@agnes512, I believe you were looking into some issues on the filter. Could you please take a look as well? Thanks.
@dhmlau this is causing by the change we made in #5808 . cc @jannyHou
The 1st level schema has include property:

While the 2nd level schema somehow doesn't have it:

Investigating.
I think the generated TodoList.ScopeFilter should also have include property. It passed before because we only validate request body but not object in query.
PR https://github.com/strongloop/loopback-next/pull/5808 introduced coercion with spec schema for query input, that's why it starts to fail.
Submitting a fix for the scope filter.
Submitted a PR to fix it: https://github.com/strongloop/loopback-next/pull/5908
(It's not really a regression, merging #5808 exposed the error, let's fix the error.)
Most helpful comment
Submitted a PR to fix it: https://github.com/strongloop/loopback-next/pull/5908
(It's not really a regression, merging #5808 exposed the error, let's fix the error.)