Commit 19463fb4 authored by Jerome Royan's avatar Jerome Royan
Browse files

All simple responses follow error schema

parent 073fd721
Loading
Loading
Loading
Loading
+30 −24
Original line number Diff line number Diff line
@@ -158,7 +158,13 @@
        #################
        # 2xx : Success #
        #################

        200_SuccessRequest:
          description: Success request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example: "Success request"
        #####################
        # 3xx : Redirection #
        #####################
@@ -169,49 +175,49 @@
        400_BadRequest:
          description: Bad request.
          content:
            text/plain:
            application/json:
              schema:
                type: string
                $ref: '#/components/schemas/Error'
              example: "Bad request"

        400_InvalidUUID:
          description: Invalid UUID supplied.
          content:
            text/plain:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example: "The format of the UUID is incorrect"
                type: string

        403_Forbidden:
          description: Not allowed.
          content: 
            text/plain:
            application/json:
              schema:
                type: string
                $ref: '#/components/schemas/Error'
              example: "Not allowed"
                
        404_NotFound:
          description: Not found.
          content:
            text/plain:
            application/json:
              schema:
                type: string
                $ref: '#/components/schemas/Error'
              example: "Not found"

        404_NotFoundUUID:
          description: Not found, could not find UUID in database.
          content:
            text/plain:
            application/json:
              schema:
                type: string
                $ref: '#/components/schemas/Error'
              example: "Element not found"
                  
        405_NotSupported:
          description: Not supported.
          content:
            text/plain:
            application/json:
              schema:
                type: string
                $ref: '#/components/schemas/Error'
              example: "Not supported"        

        4xx_UnexpectedError:      # Can be referenced as '#/components/responses/GenericError'
@@ -224,9 +230,9 @@
        409_NotEmptyUUID:
          description: Invalid UUID, id must be a Nil value.
          content: 
            text/plain:
            application/json:
              schema:
                type: string
                $ref: '#/components/schemas/Error'
              example: "The element you sent has already a value and can't be sent to the world storage"

        ########################