Skip to content

Can walk on a json_schema be used to modify the JSON payload (such as setting defaults or encrypting property values)? #623

Answered by danielaparker
rayokota asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rayokota
Comment options

Answer selected by rayokota
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants