openapi: 3.0.0
info:
  description: Schema
  version: 1.0.0
  title: Schema with various data
paths:
  /schema/person:
    get:
      summary: Person Schema
      description: Sample Schema of `person`
      requestBody:
        content:
          applicaton/json:
            schema:
              $ref: '#/components/schemas/Person'
                   
components:
  schemas:
    Category:
      type: object
      properties:
        id:
          description: Category ID
          allOf:
            - $ref: '#/components/schemas/Id'
        name:
          description: Category name
          type: string
          minLength: 1
    Id:
      type: integer
      format: int64
      readOnly: true
    Person:
      type: object
      required:
        - name
        - photoUrls
      properties:
        id:
          description: Pet ID
          allOf:
            - $ref: '#/components/schemas/Id'
        category:
          description: Categories this pet belongs to
          allOf:
            - $ref: '#/components/schemas/Category'
        DependentIds:
          type: array
          description: IDs of Dependents .
          items:
            type: integer
          example:
            - 278
            - 279
            - 280
            - 281
        name:
          description: Name of the person
          type: object
          properties:
            firstName:
              description: First name and prefix
              type: object
              properties:
                prefix:
                  description: Prefix
                  type: string
                name:
                  description: First name only
                  type: string
            lastName:
              description: Last name
              type: string
              minLength: 3
        photoUrls:
          description: The list of URL to a cute photos featuring pet
          type: array
          maxItems: 20
          items:
            type: string
            format: url
        tags:
          description: Tags attached to the pet
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Tag'
        maritalStatus:
          type: string
          description: Pet status in the store
          enum:
            - married
            - unmarried
            - widowed
        phone:
          description: phone number in international format
          type: string
          pattern: '/^\+(?:[0-9]-?){6,14}[0-9]$/'
          example: +1-202-555-0192
          nullable: true
    Tag:
      type: object
      properties:
        id:
          description: Tag ID
          allOf:
            - $ref: '#/components/schemas/Id'
        name:
          description: Tag name
          type: string
          minLength: 1