Skip to content

YAGIRO practice

Distinguish a missing field, an empty string and null

Compare three versions of a lantern inspection entry. The second note looks blank in a grid, but its JSON representation changes what the checker can read.

Establish the first record

Open absent.json and find lantern A02. Its note says wick trimmed. Use those two field names as your reference when reading the entry for A03.

The second object contains only lantern. Run the JSON table check. It refuses the second record because its set of names differs from the first. The absence of a note member is visible in the source.

Count a stored empty string

In empty-string.json, A03 has a note member followed by a pair of empty quotation marks. Both objects now have the same two names and both values on each row are strings.

Run the checker on this file. Expect two rows, two columns and one empty cell. The zero-length note is present, so a reader can still address it by the name note.

Identify a different JSON type

In null.json, A03 has an explicit note member whose value is the unquoted literal null. The file is valid JSON. The table checker refuses the second record because its note has a different type from a string.

Putting quotes around null would supply a four-letter word. That is a different recorded value. Keep the supplied examples intact and use answer.json to check your observations.

Decide what a blank means here

None of the three versions says whether A03 was inspected. To answer that question, look for an inspection log or an agreed rule that explains how the note field is filled out.

Record the file and representation alongside your conclusion. If a destination requires every note to be a string, settle how to represent missing information before preparing another export.

Files for this exercise

Fictional JSON and JSON Lines practice data. Use the file labeled as input in the tool. The answer files describe accepted results or expected refusals; compare them with your result.

Reference sources

Continue with a check