You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below (which I use for unit testing) fails with the error below. If I use serde_json::from_str() the same JSON as a string is parsed with no problems. Is this expected?
error: recursion limit reached while expanding `json_internal!`
--> src/main.rs:2:13
|
2 | let _ = serde_json::json!({
| _____________^
3 | | "EnableFeature1": true,
4 | | "EnforceOperationFoo": true,
5 | | "EnforceOperationBar": true,
... |
44 | | "PropertyPathPrefix": "/etc/foo/bar/baz/company/SOMETHING/my-service"
45 | | });
| |______^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`playground`)
= note: this error originates in the macro `json_internal` which comes from the expansion of the macro `serde_json::json` (in Nightly builds, run with -Z macro-backtrace for more info)
The code below (which I use for unit testing) fails with the error below. If I use
serde_json::from_str()
the same JSON as a string is parsed with no problems. Is this expected?The error can be reproduced trivially here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c9b62d7c6508bf68f007336f91e2788a
The text was updated successfully, but these errors were encountered: