What you will learn
JSON is a text format for data. Braces contain an object with named fields; square brackets contain a list. Quoted text is a string, unquoted numbers are numeric values and true/false are booleans. Missing and null are different.
Your goals
- Read nested fields without writing code.
- Identify data types and an absent field.
Before you start
Read the previous lesson first if you have not already. This course does not require programming.
Practice setup
These requests use the public TestKru teaching API. No workspace is needed unless a step says so. Leave the body empty for GET, HEAD and OPTIONS. Example people and emails are fictional. Changes to /api/users are simulated and are not saved.
Follow these steps
- Send the user request. Leave the body empty and select that response. It is one object, not the list from the previous lesson.
- Send the product request. In the body, open category and read the name inside it. Select that response.
- Send the book request. Find the name inside author, and look at the tags list. Select that response.
- Copy the category name and the author name from the responses you selected. Choose the JSON type of specs.inStock. Choose whether middleName is in the product.
- Submit Answers. If a check needs attention, open the response named in that check and correct that answer.
Investigate before concluding
First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.
What to keep as evidence
- All three different resources were read.
- Nested values match the selected responses.
- Boolean, array, null and absence are not confused.
References for this lesson
Finish this assignment
Select each named response with Use this response. Answer from those responses or the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. Core checks are required to finish. Extra evidence checks are labelled. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.
If something goes wrong
- Change one part of the request at a time. If a check needs attention, read the note under it and compare it with the response you selected.
Self-review and independent variation
- All three different resources were read.
- Nested values match the selected responses.
- Boolean, array, null and absence are not confused.
Read product 4 independently and explain why false is still a valid boolean.
Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.