
422 error

A success answer with the entries in an array like this I suppose: https://github.com/strongloop/loopback/issues/1275#issuecomment-264409854
[
{
"id": "3"
"name": "array one"
},
{
"id": "4"
"name": "array two"
}
]
https://github.com/mathias22osterhagen22/loopback-array-post-sample
Seems like it was working on the previous version?
https://stackoverflow.com/a/54955999/12530707
@mathias22osterhagen22 : You can also use
Promise<People[]> {
return await this.peopleRepository.createAll(people)
}
@achrinza we can close this issue as its solved..
Just to summarise,
@requestBody.array() is needed to allow OpenAPI validation to accept an array of the model.yourRepoHere.createAll() is needed to allow the ORM to accept an array of the model.I'll close this issue due to no reply, and the question being straightforward and well-documented;
Feel free to ping this issue if the problem is not resolved.