Why do I get “The passed json is nested too deeply.” when consuming the API?
Sometimes while consuming the API it returns with a status code 400, “Body not valid! The passed json is nested too deeply.”
What’s the reason for this error?
The locize API generally only accepts flat json.
For example this would not be a valid body:
this has to be sent like this:
optional context (the exception):
In case you want to also save a context information for a specific translation, you can define a nested object like this:
"default value"
is now defined as nested value for the "new.key"
key. And next to the "value"
property there is the “context” property containing an object having a "text"
property describing the context for "new.key"
key.
For more information consult the API documentation.
Last updated