openapi: '3.0.0'
info:
  version: 1.0.0
  title: Serverless Import Swagger
  description: Test Swagger Spec
paths:
  /authentication/signup:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AuthenticationSignupParams"
      tags:
        - sls-authentication
      responses:
        200:
          description: Register success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthenticationSignupResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

  /authentication/confirm-signup:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AuthenticationConfirmSignupParams"
      tags:
        - sls-authentication
      responses:
        200:
          description: Confirm signup success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthenticationConfirmSignupResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /authentication/signin/email:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AuthenticationSigninParams"
      tags:
        - sls-authentication
      responses:
        200:
          description: Signin success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthenticationSigninResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

  /test:
    get:
      tags:
        - sls-test
      responses:
        200:
          description: Request Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /test/{id}:
    get:
      tags:
        - sls-test
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Request Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /test/{testId}/comments/users:
    get:
      tags:
        - sls-test
      parameters:
        - name: testId
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Request Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /test/{testId}/users/{userId}/comments:
    get:
      tags:
        - sls-test
      parameters:
        - name: testId
          in: path
          required: true
          schema:
            type: string
        - name: userId
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Request Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /test/{testId}/users/{userId}/comments/{commentId}:
    get:
      tags:
        - sls-test
      parameters:
        - name: testId
          in: path
          required: true
          schema:
            type: string
        - name: userId
          in: path
          required: true
          schema:
            type: string
        - name: commentId
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Request Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /user/testings/{testingId}/categories/{categorieId}/comments:
    get:
      tags:
        - sls-test
      parameters:
        - name: testingId
          in: path
          required: true
          schema:
            type: string
        - name: categorieId
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Request Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestResponse"
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

components:
  schemas:
    AuthenticationSignupParams:
      type: object
      properties:
        email:
          type: string
        password:
          type: string
          format: password
    AuthenticationSignupResponseData:
      type: object
      properties:
        username:
          type: string
    AuthenticationSignupResponse:
      type: object
      properties:
        code:
          type: integer
        data:
          $ref: "#/components/schemas/AuthenticationSignupResponseData"
        message:
          type: string
  
    AuthenticationConfirmSignupParams:
      type: object
      properties:
        username:
          type: string
        confirmationCode:
          type: string
    AuthenticationConfirmSignupResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  
    AuthenticationSigninParams:
      type: object
      properties:
        email:
          type: string
        passwprd:
          type: string
          format: password
    AuthenticationSigninResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  
    Test:
      type: object
      properties:
        key:
          type: string
    TestResponse:
      type: object
      properties:
        code:
          type: integer
        data:
          $ref: "#/components/schemas/Test"
        message:
          type: string
  
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
