---
openapi: 3.1.0
info:
  title: Mombit Bx API
  description: Test Mombit Bx API
  termsOfService: https://mombit.tc-dev.ru/terms/
  contact:
    email: apiteam@mombit.ru
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.0.1
servers:
- url: https://mombit.tc-dev.ru/api/mombit/
tags:
- name: review
  description: Users reviews
paths:
  /review:
    put:
      tags:
      - review
      summary: Update an existing review
      description: Update an existing review by Id.
      operationId: updateReview
      requestBody:
        description: Update an existent review.
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  format: int64
                  examples:
                  - 10
                userId:
                  type: integer
                  format: int64
                  examples:
                  - 10
                userFio:
                  type: string
                  examples:
                  - Vasya Pupkin
                raiting:
                  type: integer
                  format: int5
                  examples:
                  - 5
                review:
                  type: string
                  examples:
                  - "Test review #1"
                supportId:
                  type: integer
                  format: int64
                  examples:
                  - 10
                answer:
                  type: string
                  examples:
                  - "Answer for test review #1"
        required: true
      responses:
        "200":
          description: Successful / failed operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  id:
                    type: integer
                  msg:
                    type: string
      security:
      - bearerAuth: []
    post:
      tags:
      - review
      summary: Add a new review or update
      description: Add a new review to the store
      operationId: addReview
      requestBody:
        description: Create a new review in the store
        content:
          application/json:
            schema:
              required:
              - id
              - userFio
              type: object
              properties:
                id:
                  type: integer
                  format: int64
                  examples:
                  - 10
                userId:
                  type: integer
                  format: int64
                  examples:
                  - 10
                userFio:
                  type: string
                  examples:
                  - Vasya Pupkin
                raiting:
                  type: integer
                  format: int5
                  examples:
                  - 5
                review:
                  type: string
                  examples:
                  - "Test review #1"
                supportId:
                  type: integer
                  format: int64
                  examples:
                  - 10
                answer:
                  type: string
                  examples:
                  - "Answer for test review #1"
        required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                required:
                - id
                - userFio
                type: object
                properties:
                  id:
                    type: integer
                    format: int64
                    examples:
                    - 10
                  userId:
                    type: integer
                    format: int64
                    examples:
                    - 10
                  userFio:
                    type: string
                    examples:
                    - Vasya Pupkin
                  raiting:
                    type: integer
                    format: int5
                    examples:
                    - 5
                  review:
                    type: string
                    examples:
                    - "Test review #1"
                  supportId:
                    type: integer
                    format: int64
                    examples:
                    - 10
                  answer:
                    type: string
                    examples:
                    - "Answer for test review #1"
      security:
      - bearerAuth: []
  /review/{reviewId}:
    get:
      tags:
      - review
      summary: Find review by Id
      description: Returns a single review
      operationId: getReviewById
      parameters:
      - name: reviewId
        in: path
        description: Id of review to return
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: successful operation
          content:
            application/json:
              schema:
                required:
                - id
                - userFio
                type: object
                properties:
                  id:
                    type: integer
                    format: int64
                    examples:
                    - 10
                  userId:
                    type: integer
                    format: int64
                    examples:
                    - 10
                  userFio:
                    type: string
                    examples:
                    - Vasya Pupkin
                  raiting:
                    type: integer
                    format: int5
                    examples:
                    - 5
                  review:
                    type: string
                    examples:
                    - "Test review #1"
                  supportId:
                    type: integer
                    format: int64
                    examples:
                    - 10
                  answer:
                    type: string
                    examples:
                    - "Answer for test review #1"
        "400":
          description: Invalid Id supplied
        "404":
          description: Review not found
      security:
      - bearerAuth: []
    post:
      tags:
      - review
      summary: Updates a review in the store with form data
      description: ""
      operationId: updateReviewWithForm
      parameters:
      - name: reviewId
        in: path
        description: Id of review that needs to be updated
        required: true
        schema:
          type: integer
          format: int64
      - name: userId
        in: query
        description: Reviewer Id of review that needs to be updated
        schema:
          type: integer
          format: int64
      - name: supportId
        in: query
        description: Support Id of review that needs to be updated
        schema:
          type: integer
          format: int64
      - name: raiting
        in: query
        description: Raiting of review that needs to be updated
        schema:
          type: integer
          format: int5
      - name: userFio
        in: query
        description: User FIO of review that needs to be updated
        schema:
          type: string
      - name: review
        in: query
        description: Text of review that needs to be updated
        schema:
          type: string
      - name: answer
        in: query
        description: Answer of review that needs to be updated
        schema:
          type: string
      responses:
        "405":
          description: Invalid input
      security:
      - bearerAuth: []
    delete:
      tags:
      - review
      summary: Deletes a review
      description: delete a review
      operationId: deleteReview
      parameters:
      - name: api_key
        in: header
        description: ""
        required: true
        schema:
          type: string
      - name: reviewId
        in: path
        description: Review id to delete
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "400":
          description: Invalid review value
      security:
      - bearerAuth: []
components:
  schemas:
    Review:
      required:
      - id
      - userFio
      type: object
      properties:
        id:
          type: integer
          format: int64
          examples:
          - 10
        userId:
          type: integer
          format: int64
          examples:
          - 10
        userFio:
          type: string
          examples:
          - Vasya Pupkin
        raiting:
          type: integer
          format: int5
          examples:
          - 5
        review:
          type: string
          examples:
          - "Test review #1"
        supportId:
          type: integer
          format: int64
          examples:
          - 10
        answer:
          type: string
          examples:
          - "Answer for test review #1"
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        id:
          type: integer
        msg:
          type: string
  requestBodies:
    Review:
      description: Review object that needs to be added to the store
      content:
        application/json:
          schema:
            required:
            - id
            - userFio
            type: object
            properties:
              id:
                type: integer
                format: int64
                examples:
                - 10
              userId:
                type: integer
                format: int64
                examples:
                - 10
              userFio:
                type: string
                examples:
                - Vasya Pupkin
              raiting:
                type: integer
                format: int5
                examples:
                - 5
              review:
                type: string
                examples:
                - "Test review #1"
              supportId:
                type: integer
                format: int64
                examples:
                - 10
              answer:
                type: string
                examples:
                - "Answer for test review #1"
  responses:
    UnauthorizedError:
      description: Access token is missing or invalid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
