Skip to content
Discussion options

You must be logged in to vote

Hi, thank you for your enquiry! It is fine to post it here as it could be an enhancement request. Your code tests whether the value assigned to the key father exists, but not whether this key exists altogether.

To test whether a key contains an empty value, you can test the value against \empty (similar like what you tried in your example, but you need to store the parsed value into some token variable that you then can use for comparison):

\documentclass{article}
\usepackage{jsonparse}

\begin{document}

\JSONParse{\myjson}{ { "foo" : "" , "bar" : "baz" } }
\JSONParseValue[store in=\myvalueA]{\myjson}{foo}
\JSONParseValue[store in=\myvalueB]{\myjson}{bar}

\ifx\myvalueA\empty
    empty
\…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by jasperhabicht
Comment options

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

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
Converted from issue

This discussion was converted from issue #77 on September 03, 2025 16:16.