json-server
json-server copied to clipboard
Feat: Support for bulk insertion
Added support for bulk insertion when posting array to plural and nested routes.
POST /posts
POST /posts/1/comments
When a single object is posted it work as usual, when an array (of objects) is posted it will perform bulk insertion.
Also the id field is parsed into number to fix match issues, see #396
@typicode could we get this feature merged?
Any updates on when this may get merged?
I completely forgot that id can be non numeric also.. I'll update this and put some tests for that too, thanks!
We actually needed the fix really badly, so we created our own fix. See: https://github.com/NavaraBV/json-server/commit/699c27e82e33d08aceef5fa8fc53dd6cd7070ec7
(somehow the test that is commented out there was failing on my machine, you can ignore that change)
LGTM now!
Any reason why this hasn't been merged yet?
Will this be merged soon?