The @bitovi/sequelize-querystring-parser and @bitovi/objection-querystring-parser packages are returning errors a when filtering with single-valued array-operators.
Below is a list of examples showing the http request and the response body. Most of the issues seem to be with the any(), $in, and $nin operators handling single values. They should be able to handle 1 or more values.
Objection Issues
// 1. GET localhost:3000/students?filter=any(house,'Gryffindor')
{
"errors": "select `hogwarts`.* from `hogwarts` where `house` in 'Gryffindor' - SQLITE_ERROR: near \"?\": syntax error"
}
// 2. GET localhost:3000/students?filter[house][$in]=Gryffindor
{
"errors": "select `hogwarts`.* from `hogwarts` where `house` in 'Gryffindor' - SQLITE_ERROR: near \"?\": syntax error"
}
// 3. GET localhost:3000/students?filter[house][$nin]=Gryffindor
{
"errors": "select `hogwarts`.* from `hogwarts` where `house` not in 'Gryffindor' - SQLITE_ERROR: near \"?\": syntax error"
}
Sequelize Issues
// 4. GET localhost:3000/students?filter=any(house,'Gryffindor')
{
"errors": "value.map is not a function"
}
// 5. GET localhost:3000/students?filter[house][$in]=Gryffindor
{
"errors": "value.map is not a function"
}
// 6. GET localhost:3000/students?filter[house][$nin]=Gryffindor,Slytherin
{
"errors": "Invalid value { undefined: [ 'Gryffindor', 'Slytherin' ] }"
}
// 7. GET localhost:3000/students?filter[house][$nin]=Gryffindor
{
"errors": "Invalid value { undefined: 'Gryffindor' }"
}
The
@bitovi/sequelize-querystring-parser
and@bitovi/objection-querystring-parser
packages are returning errors a when filtering with single-valued array-operators.Below is a list of examples showing the http request and the response body. Most of the issues seem to be with the
any()
,$in
, and$nin
operators handling single values. They should be able to handle 1 or more values.Objection Issues
Sequelize Issues
Steps to Reproduce
Acceptance Criteria
any()
,$in
, and$nin
operators with 1 or more values should return valid results instead of errorsReferences