openapi: 3.1.0
info:
  title: Sample Pet Store App
  summary: A pet store manager.
  description: This is a sample server for a pet store.
  termsOfService: https://example.com/terms/
  contact:
    name: API Support
    url: https://www.example.com/support
    email: support@example.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.1
webhooks:
  newPet:
    post:
      requestBody:
        description: Information about a new pet in the system
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pet"
      responses:
        "200":
          description: Return a 200 status to indicate that the data was received successfully
paths:
  /person:
    post:
      summary: Demonstrates data-types and constraints
      description: Request-Parameters and Response-Schema contains various data types and constrains. Check out how is it desplayed below
      parameters:
        - name: height
          in: query
          description: height (in inches)
          required: true
          example: 70
          schema:
            type: integer
            format: int32
            minimum: 12
            maximum: 120
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/person'
tags:
  - name: Person
    description: Person Datatype
components:
  schemas:
    location:
      description: longitude/latitude or city name
      type: 
        - object
        - string
      properties:
        longitude:
          type: 
            - number
            - string
        latitude:
          type: 
            - number
            - string
    person:
      type: object
      required:
        - id
        - photoUrls
      properties:
        id:
          description: Person ID
          type: 
            - string
            - integer
          minLength: 4
          example: Guru
        name:
          description: Name of the person
          type: 
            - string
            - 'null'
          minLength: 4
          example: Guru
        age:
          description: Age of Person
          type: 
            - integer
            - number
        photoUrls:
          description: One or more URL's
          type: 
            - string
            - array
          maxItems: 20
          minimum: 10
          items:
            type: string
            format: url
        hobby:
          description: comma separated list of hobbies or an array of object 
          type:
            - string 
            - array
          items:
            type: object
            properties:
              hobbyRank:
                type:
                  - integer
                  - number
              hobbyName:
                type: string
        location:
          description: Location
          type: 
            - array
            - integer
          minimum: 10  
          minItems: 1
          items:
            $ref: '#/components/schemas/location'
        tag:
          description: A tag-object or comma separated text
          type: 
            - object
            - string
          properties:
            tagId:
              description: Tag ID
              type: string
            tagDefinition:
              description: Tag properties or plain text
              minLength: 1
              type: 
                - object
                - string
              properties:
                tagText:
                  description: Text inside the tag
                  minLength: 1
                  type: string
                tagColor:
                  description: Color of Tag in RGB or Color Name
                  type: 
                    - string
                    - object
                  properties:
                    red:
                      type: integer
                    green:
                      type: integer
                    blue:
                      type: integer

