This chapter covers
- JSON schema keywords for validation
- Enhancing PetSitter schemas with those
The journey of the PetSitter team started with a domain model. Building upon the domain model, they created a set of common, reusable schemas in their OpenAPI definition. Then, they referenced those schemas in the requests and responses of their API operation. As we joined them in this process, we learned in chapter 13 that we can autogenerate backend code that automatically does input validation based on the schemas. We also used Prism, an OpenAPI-powered mocking and testing tool, to detect whether the API responses follow the schemas and our API backend upholds the contract described with OpenAPI.
In the third part of the book, our focus is on improving the developer experience, with the goal of making the API easier and more delightful to use as soon as other developers apart from Max start consuming it. At the end of the sprint, which is our frame of understanding for this part of the book, an external contractor will work with the API to develop a mobile application for PetSitter. And the ultimate goal that we’re working towards is releasing the API into the wild.