In the last chapter, José and his team identified new requirements from the initial user tests and planned a new development sprint. Part of that plan involved moving from a single Dog concept to multiple pets. This requirement implies changes to the domain model.
By going through the user stories, the PetSitter team realized that many parts of the domain model and, thus, the API description, can remain the same. The affected segment of the model is the Dog concept and its relationship with the Job concept, which we’ll now update.
In this chapter we’ll consider different approaches for changing the Dog concept to represent different pets in the domain model and the OpenAPI definition. We’ll look at cats and dogs for now, but our goal is finding a system that will be extensible for additional species. You’ll learn about polymorphism in domain models, the OpenAPI composition keywords, and how to apply them. At the end of this chapter, we’ll have an updated domain model and OpenAPI description that will help José’s team implement the new functional requirements.