Hello,
Api platform seems to not handle when we call a subresource route and the parent doesn't exist.
For example if I called /books/99999999/reviews and the entity Book with id 99999999 doesn't exist, it returns a 200 OK response with no items. Book OneToMany Review.
And If I tried the same thing with a OneToOne relation: /apps/999999/menu it returns 200 OK response with null in the body the same as there is no menu.
I think here it should throw a 404 error Parent not found. see this.
I tried to dive in the code base of API Platform in order to identify where this verification can be done but I haven't found out...
If someone can lead me on this I can create a PR and add this feature. I think there is a lot of case where the client need to known when the parent doesn't exist to work properly.
Thanks for your help!
Hello,
Api platform seems to not handle when we call a subresource route and the parent doesn't exist.
For example if I called
/books/99999999/reviewsand the entityBookwith id99999999doesn't exist, it returns a200 OKresponse with no items. Book OneToMany Review.And If I tried the same thing with a OneToOne relation:
/apps/999999/menuit returns200 OKresponse with null in the body the same as there is no menu.I think here it should throw a 404 error Parent not found. see this.
I tried to dive in the code base of API Platform in order to identify where this verification can be done but I haven't found out...
If someone can lead me on this I can create a PR and add this feature. I think there is a lot of case where the client need to known when the parent doesn't exist to work properly.
Thanks for your help!