JSON & YAML
Say what the parser returns
These two formats look like the easiest thing in computing, and both are parsed by machines that disagree with the person reading them. Here is the whole of it, exactly: which documents are legal, what every value becomes, where the two YAML versions differ, and how to decide a document against a schema.
- Modules
- 5
- Drills
- 12
- Build steps
- 2
- Time
- ~4h
Walk out able to
Hand someone a document and tell them what their parser will return — the structure, the type of every scalar, and whether it is accepted at all.
Prediction, not familiarity.What you will be able to predict
Legal, and what it became
The six rules that refuse a document, and what it becomes.
Numbers and round trips
Where integers stop being exact, and what round trips lose.
Escapes, quotes, code points
What a string holds, and which quotes process escapes.
YAML surprises, and schemas
Typing by version, indentation as structure, and a verdict.
The pitch
What you practise, and what you leave with
A JSON Schema you write for a real configuration, which accepts it and refuses six corruptions of it — each on a different keyword.
You will practise
- Legal documents, and the rule that refused one
- Numbers, round trips and parsed string lengths
- YAML typing, quoting, blocks and indentation
- Schema verdicts, and the keyword behind each
Afterwards you can
- Name the rule that refused a document
- Say what a YAML scalar is, and under which version
- Count what a parsed string actually holds
- Decide a document against a schema exactly
Modules
5 modules, 23 items
Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.
- 1
What the parser accepts
~39 minSay whether a document parses, name the rule that refused it, and read the value out.
- LessonWhy these two formats together5 min
- LessonPredict what the parser refuses10 min
- LessonSee what a repeated key does4 min
- DrillName the rule that refused it10 min
- DrillWalk a document to a value10 min
- 2
What the value is
~32 minPredict the number that comes back, and name what a round trip quietly removed.
- DrillRead the integer back10 min
- LessonFind where the number changes12 min
- DrillSay what the round trip dropped10 min
- 3
Escapes, quotes and code points
~42 minCount what a parsed string holds, and pick a quoting style knowing what it processes.
- LessonNine escapes, and nothing else5 min
- LessonCount what the string really holds8 min
- DrillMeasure the parsed string10 min
- DrillSpot the escape that is refused9 min
- DrillSay what each quoting style holds10 min
- 4
Where YAML disagrees with you
~48 minType any scalar the way a named parser will, and read an indented block exactly.
- LessonMeet the value you did not write11 min
- LessonReuse a block with an anchor6 min
- DrillType the scalar as the parser will11 min
- DrillRead a block scalar exactly10 min
- DrillRead the indentation as structure10 min
- 5
Decide it against a schema
~59 minGive a verdict, name the keyword behind it, then write the schema yourself.
- LessonRead a schema as a claim13 min
- DrillGive the verdict, name the keyword11 min
- DrillCount what survives the schema10 min
- Build stepWrite the schema that accepts it12 min
- Build stepBreak it seven ways, and count13 min
More in Tools & workflow
Keep going
Regex
Read the pattern. Then predict exactly what it does.
Intermediate~4h6 modules
Git: The Model
Stop memorising the commands. Learn what they move.
Intermediate~5h6 modules
Git: Collaboration
Two people, one history, and no surprises.
Intermediate~5h7 modules
VS Code
Stop guessing what the window just did.
Foundational~4h6 modules
Two formats you can read. Neither one means what you think.
The first item is free. ~4h of focused work, at your own pace.
Intermediate~4h5 modules