-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checking keys of two jsons against eachother #1465
Comments
You could try the |
I am not sure whether there is an easier way of checking that, but here is a solution:
I haven't tested it thoroughly though. Please check it before using it in production. |
@simulationcloud Forget the above function. Based on nlohmann comment, there is already infrastructure for comparing two JSONs. It also let you find out which values has been actually overridden by the user (indicated by |
@simulationcloud Do you need further assistance? |
No, you answered my question. Thank you very much!
… On February 10, 2019 at 3:52 PM Niels Lohmann ***@***.***> wrote:
@simulationcloud https://github.com/simulationcloud Do you need further assistance?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #1465 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AfyT_ueB2eV7shoih7gOlPLEx-HjiPFEks5vMIafgaJpZM4aadm6 .
|
So, I have two JSON configuration files that may be nested multiple layers deep. One consists of all possible parameters a user can input set to their default value. The other is JSON input from a user. I want to check that no key (including nested keys) exists in the user JSON that does not exist in the configuration JSON.
Is there a simple way to do this?
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: