You might have noticed that our specification is not very DRY – we are repeatedly specifying common responses like the 500 Internal Error. Therefore, before we learn how to specify URL parameters and our security schemes, let's first see how we can use the components root property to define common entities in a single location, and reference it throughout the OpenAPI specification. We will do this for our Create User object, as well as all our responses.
Let's start by adding the following components section as a root property to our specification:
components: schemas: Profile: title: User Profile type: object properties: bio: type: string summary: type: string name: type: object properties: first: type: string ...