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

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.…

Contents