Skip to Content
Unifying Business, Data, and Code
book

Unifying Business, Data, and Code

by Ron Itelman, Juan Cruz Viotti
January 2024
Intermediate to advanced
356 pages
9h 53m
English
O'Reilly Media, Inc.
Audio summary available
Content preview from Unifying Business, Data, and Code

Chapter 13. Extending JSON Schema

Once we accept our limits, we go beyond them.

Albert Einstein

JSON Schema is used in a wide range of disparate use cases, from UI generation to data serialization. Given its wide applicability, the JSON Schema organization cannot possibly foresee every required feature. While the vocabularies that the JSON Schema organization defines are enormously powerful, there are cases for which you need to look beyond what’s offered out of the box. You saw a glimpse of this in Chapter 12, when JSON Schema didn’t provide keywords for declaring some of the metadata we wanted for the context facet of our example data product.

In Chapter 5, you learned an important skill: how to methodically understand every JSON Schema and consult documentation for keywords and vocabularies you haven’t seen before. This chapter builds on that to show how to define custom keywords that can do almost anything you want.

There are two ways in which you can extend JSON Schema:

  1. Exploit how JSON Schema collects annotations for unknown keywords (what we refer to as the simple case).

  2. Properly define and publish a JSON Schema vocabulary (what we call the complex case).

Although the simple case is easy to get going, it imposes limitations on how much you can make your keywords do.

Simple Case: Unknown Keywords

When performing validation, JSON Schema implementations will silently ignore any keywords they do not recognize. This fact can be easily exploited to add arbitrary metadata ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Unlock Complex and Streaming Data with Declarative Data Pipelines

Unlock Complex and Streaming Data with Declarative Data Pipelines

Ori Rafael, Roy Hasson, Rick Bilodeau
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
How to Develop a Great Digital Strategy

How to Develop a Great Digital Strategy

Jeanne W. Ross, Cynthia M. Beath, Ina M. Sebastian

Publisher Resources

ISBN: 9781098144999Errata Page