96: Check json payload on document addition r=curquiza a=MarinPostma

Check if the json payload in updates is valid. It uses a json validator to avoid allocation, and only serializes the json in case of error, to return a pretty message.

Co-authored-by: mpostma <postma.marin@protonmail.com>
This commit is contained in:
bors[bot]
2021-03-16 17:20:44 +00:00
committed by GitHub
3 changed files with 42 additions and 4 deletions

7
Cargo.lock generated
View File

@ -1823,6 +1823,7 @@ dependencies = [
"milli",
"mime",
"once_cell",
"oxidized-json-checker",
"parking_lot",
"rand 0.7.3",
"rayon",
@ -2122,6 +2123,12 @@ dependencies = [
"num-traits",
]
[[package]]
name = "oxidized-json-checker"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "938464aebf563f48ab86d1cfc0e2df952985c0b814d3108f41d1b85e7f5b0dac"
[[package]]
name = "page_size"
version = "0.4.2"