From the course: Learn API Documentation with JSON and XML
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Documenting nested JSON responses
From the course: Learn API Documentation with JSON and XML
Documenting nested JSON responses
- [Instructor] Now let's look at more complex JSON files that use nested data. Most JSON files have some level of nesting. This means that objects will include arrays or other objects, and arrays can include objects or other arrays. So for example, if we took our simple example from earlier, and wrapped all the data in an employee object, it would look like this. This object has two levels of nesting. In our tables, we need to indicate how various objects fit inside each other. There are basically two ways to handle documentation to indicate nesting. One is to use indentation, where each indent indicates a level of nesting. This is best to use when objects are not reused much. If you have a situation where you're going to be reusing the same object type in several different tables, you may want to have a table for each type of object. This way you can link to the tables and avoid duplication. The only disadvantage of this is that it tends to take up more space. Here's the example I…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
JSON basics2m 45s
-
(Locked)
JSON examples6m 14s
-
(Locked)
Create JSON challenge37s
-
(Locked)
Create JSON solution1m 22s
-
(Locked)
Documenting one-level JSON responses2m 28s
-
(Locked)
Documenting nested JSON responses6m 7s
-
(Locked)
Documenting JSON requests5m 32s
-
(Locked)
Documenting JSON challenge35s
-
(Locked)
Documenting JSON solution2m 47s
-
-
-
-