From the course: JSON Essential Training
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Create a basic schema with JSON Schema - JavaScript Tutorial
From the course: JSON Essential Training
Create a basic schema with JSON Schema
- [Instructor] I want to create a schema to describe the product data available from the H+ Sport API. To start, I want to look at the data return for a sample request. So, I'm looking at data.js. Now, this is the data I would normally get from an HTTP request to the API. But for the purpose of creating a schema, I've stored the data from a request in my file. Right now, this is JSON. It's a string and the editor won't display it for me with line breaks and indents. But I can open product study HTML, start up my live server and look at it in the console. So, I'll go ahead and open that HTML file. Start up my HTTP server and then opening up the console. My project includes JavaScript code that parses the JSON strings into JavaScript objects and then logs these to the console. And now, I can examine the structure of this data. It's an array and it contains six objects. And each object contains the same five properties.…
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
-
-
-
-
-
-
-
(Locked)
What is JSON Schema?2m 57s
-
(Locked)
Create a basic schema with JSON Schema6m 47s
-
(Locked)
Validate JSON data against a schema3m 42s
-
(Locked)
Specify required properties with JSON Schema4m 59s
-
(Locked)
Work with schema generators7m 29s
-
(Locked)
Challenge: Work with JSON Schema52s
-
(Locked)
Solution: Work with JSON Schema4m 23s
-
(Locked)
-
-