openapi: 3.0.2
info:
  title: 'Question Generator API'
  version: 0.0.1
paths:
  /api/database/components:
    get:
      operationId: downloadComponents
      summary: Retrieves Product Components in csv format
      responses:
        200:
          description: Product Components
          content:
            text/csv:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProductComponent'
  /api/get/components/{productID}:
    get:
      operationId: getComponents
      summary: Retrieves Products Components
      responses:
        '200':
          description: Get Products Components
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProductComponent'
      parameters:
        - name: productID
          in: path
          required: true
          schema:
            type: integer

  /api/generate/random:
    x-swagger-router-controller: test
    get:
      operationId: generateRandom
      summary: Generate random quiz
      responses:
        '200':
          description: Generated quiz
          content:
            application/json:
              schema:
                type: object
                items:
                  $ref: '#/components/schemas/Quiz'
      parameters:
        - name: seed
          in: query
          required: false
          description: initialize random state. Make response determined
          schema:
            type: string
        - name: photo
          in: query
          required: false
          schema:
            type: boolean
        - name: type
          in: query
          required: false
          description: 1 - products, 2 - standards
          schema:
            type: integer


components:
  schemas:
    ProductComponent:
      type: object
      description: Component of a product
      properties:
        productID:
          type: integer
        name:
          type: string
    Quiz:
      type: object
      description: quiz
