OpenApi Spec - What is the best practice that multiple microservices use the same components schema (data model) ?
Example:
Microservice1 api spec:
responses:
$ref: '#/components/schemas/MyResponse'
components:
schemas:
MyResponse:
type: object
required:
true
properties:
myvariable1:
type: string
myvariable2:
type: string
Microservice2 api spec:
responses: $ref: '#/components/schemas/MyResponse'
components:
schemas:
MyResponse:
type: object
required:
true
properties:
myvariable1:
type: string
myvariable2:
type: string
Is there any way that both microservices 1 and 2 can used the components schema from a centralized place? so that consistency can be maintained among both microservices?