swagger: '2.0'
info:
  version: 1.0.0
  title: Serverless Import Swagger
  description: Test Swagger Spec
consumes:
  - application/json
produces:
  - application/json
paths:
  /authentication/signup:
    post:
      parameters:
        - name: params
          in: body
          required: true
          schema:
            $ref: "#/definitions/AuthenticationSignupParams"
      tags:
        - sls-authentication
      responses:
        200:
          description: Register success
          schema:
            $ref: "#/definitions/AuthenticationSignupResponse"
        default:
          description: Unexpected error
          schema:
            $ref: "#/definitions/Error"

  /authentication/confirm-signup:
    post:
      parameters:
        - name: params
          in: body
          required: true
          schema:
            $ref: "#/definitions/AuthenticationConfirmSignupParams"
      tags:
        - sls-authentication
      responses:
        200:
          description: Confirm signup success
          schema:
            $ref: "#/definitions/AuthenticationConfirmSignupResponse"
        default:
          description: Unexpected error
          schema:
            $ref: "#/definitions/Error"
  /authentication/signin/email:
    post:
      parameters:
        - name: params
          in: body
          required: true
          schema:
            $ref: "#/definitions/AuthenticationSigninParams"
      tags:
        - sls-authentication
      responses:
        200:
          description: Signin success
          schema:
            $ref: "#/definitions/AuthenticationSigninResponse"
        default:
          description: Unexpected error
          schema:
            $ref: "#/definitions/Error"

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


definitions:
  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: "#/definitions/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: "#/definitions/Test"
      message:
        type: string

  Error:
    type: object
    properties:
      code:
        type: integer
      message:
        type: string
