Specifying a unique ID

Lastly, we should include the $id keyword, which defines a unique URI for our schema. This URI can be used by other schemas to reference our schema, for example, when using our schema as a sub-schema. For now, just set it to a valid URL, preferably using a domain that you control:

"$id": "http://api.hobnob.social/schemas/users/profile.json"
If you don't know how to purchase a domain, we will show you in Chapter 10Deploying Your Application on a VPS. For now, just use a dummy domain like example.com.

Our finished JSON Schema should look like this:

{  "$schema": "http://json-schema.org/schema#",  "$id": "http://api.hobnob.social/schemas/users/profile.json",  "title": "User Profile Schema", "description": "For validating ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.