Can walk on a json_schema be used to modify the JSON payload (such as setting defaults or encrypting property values)? #623
-
Can walk on a json_schema be used to modify the JSON payload (such as setting defaults or encrypting property values)? |
Beta Was this translation helpful? Give feedback.
Answered by
danielaparker
Jul 25, 2025
Replies: 1 comment 1 reply
-
It's not an intended feature, the validate functions take a const reference to the JSON document, and the walk callback receives a const reference to a JSON value in the original document as an argument. I'm not sure what the implications would be of casting away constness in the walk callback, and mutating a property. It might work. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rayokota
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not an intended feature, the validate functions take a const reference to the JSON document, and the walk callback receives a const reference to a JSON value in the original document as an argument. I'm not sure what the implications would be of casting away constness in the walk callback, and mutating a property. It might work.