Member-only story
In the previous post, I went on a small spike to explore generating TypeScript types from valid JSON schemas. Now, I want to look a little deeper at OpenAPI Schema validation.
This example will build a little more on top of the previous post, however, it is not required reading.
Getting Started
In a Yarn or NPM project directory, install the following:
We are also going to add in a few of the pieces I wrote for the Book schema in the previous post, so create book.json
and add the following:
The above is actually a little different to what I had in the previous blog posts, so make sure you do copy it across.
We are going to import this in and using it for our values for a component.