openapi: 3.0.2
info:
  title: HTML Injection
  version: "1.0"
servers:
  - url: https://reqres.in/api/
  - url: https://dummy/server/
security:
  - api_key1: []
paths:
  /users:
    get:
      tags:
        - user
      description: List of users (paginated)
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            example: 2
        - name: delay
          in: query
          description: for simulating response delay. Do not provide any value for page parameter(0 indicates no delay)
          examples:
            - '0'
            - 3
          schema:
            type: integer
            minimum: 0
            maximum: 10
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                description: Description of **User** object
                properties:
                  page:
                    description: Current Page number
                    type: integer
                  per_page:
                    description: Number of records per page
                    type: integer
                  total:
                    description: Total number of records
                    type: integer
                  total_pages:
                    type: integer
                  data:
                    type: array
                    description: List of users
                    items:
                      $ref: '#/components/schemas/user'
                  support:
                    $ref: '#/components/schemas/support'
    post:
      tags:
        - Create User
      summary: Create a user
      description: Create a user
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/userInput"
      responses:
        201:
          description: User creation response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/userInput'
                  - $ref: '#/components/schemas/createUserResponse'
  /users/{userId}:
    get:
      tags:
        - user
      description: Get a Single User
      parameters:
        - in: path
          name: userId
          schema:
            type: integer
            example: 3
          required: true
          description: Numeric ID of the user to get
      responses:
        200:
          description: Response when a user is found
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/user'
                  support:
                    $ref: '#/components/schemas/support'
        404:
          description: User Not found

components:
  securitySchemes:
    api_key1:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    user:
      type: object
      properties:
        id:
          description: User ID
          type: integer
        email:
          description: User Email
          type: string
        first_name:
          description: First Name
          type: string
        last_name:
          description: Last Name
          type: string
        avatar:
          description: Avatar URL
          type: string
    support:
      type: object
      properties:
        url:
          description: Support URL
          type: string
        text:
          description: Support URL - Description
          type: string
    userInput:
      type: object
      properties:
        name:
          description: User Name
          type: string
        job:
          description: Job
          type: string
    createUserResponse:
      type: object
      properties:
        id:
          type: integer
        createdAt:
          type: string

