openapi: "3.0.0"
info:
  version: 1.0.0
  title: Swagger Petstore
  license:
    name: MIT
servers:
  - url: http://petstore.swagger.io/v1
paths:
  /pets:
    get:
      summary: Get pet
      operationId: getPets
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Pet"
  /cars:
    get:
      summary: Get car
      operationId: getCar
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Cars"

components:
  schemas:
    Pet:
      required:
        - id
        - name
        - type
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string
        type:
          type: string
          enum: [ 'pet' ]
        details:
          type: object
          properties:
            race: { type: string }
    Car:
      required:
        - id
        - name
        - type
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string
        type:
          type: string
          enum: [ 'car' ]
        details:
          type: object
          properties:
            brand: { type: string }
