Commit 53fb4d63 authored by Nathan Chambron's avatar Nathan Chambron
Browse files

Update responses

parent 5b1f626d
Loading
Loading
Loading
Loading
+117 −9
Original line number Original line Diff line number Diff line
@@ -42,7 +42,12 @@ paths:
      operationId: getPing
      operationId: getPing
      responses:
      responses:
        '200':
        '200':
          description: OK, world storage alive.
          description: OK, return the UUID of the World Link defined by the world storage.
          content:
            text/plain:
              schema:
                type: string
                example: "pong"
  /admin:
  /admin:
    get:
    get:
      summary: Get the state of the server.
      summary: Get the state of the server.
@@ -50,6 +55,11 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, world storage server ready.
          description: OK, world storage server ready.
          content:
            text/plain:
              schema:
                type: string
                example: "Server up and running"
  /version:
  /version:
    get:
    get:
      summary: Get the version of the ARF API.
      summary: Get the version of the ARF API.
@@ -57,6 +67,11 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: Current version.
          description: Current version.
          content:
            text/plain:
              schema:
                type: string
                example: "1.0.0"


##############
##############
# TRACKABLES #
# TRACKABLES #
@@ -78,8 +93,18 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, return the UUID of the Trackable defined by the world storage.
          description: OK, return the UUID of the Trackable defined by the world storage.
          content:
            text/plain:
              schema:
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '201':
        '201':
          description: Null response.
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
        '400':
        '400':
          $ref: '#/components/responses/400_BadRequest'
          $ref: '#/components/responses/400_BadRequest'
        '409': 
        '409': 
@@ -102,6 +127,11 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, return the UUID of the modified Trackable.
          description: OK, return the UUID of the modified Trackable.
          content:
            text/plain:
              schema:
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '400':
        '400':
          $ref: '#/components/responses/400_BadRequest'
          $ref: '#/components/responses/400_BadRequest'
        '404': 
        '404': 
@@ -125,6 +155,11 @@ paths:
                  $ref: "#/components/schemas/Trackable"          
                  $ref: "#/components/schemas/Trackable"          
        '201':
        '201':
          description: Null response.
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
        default:
        default:
          $ref: '#/components/responses/4xx_UnexpectedError'
          $ref: '#/components/responses/4xx_UnexpectedError'


@@ -171,6 +206,11 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, delete successful.
          description: OK, delete successful.
          content:
            text/plain:
              schema:
                type: string
                example: "Element succesfully deleted"
        '400':
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
          $ref: '#/components/responses/400_InvalidUUID'
        '404':
        '404':
@@ -196,8 +236,18 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, return the UUID of the World Anchor defined by the world storage.
          description: OK, return the UUID of the World Anchor defined by the world storage.
          content:
            text/plain:
              schema:
                type: string    
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '201':
        '201':
          description: Null response.
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
        '400':
        '400':
          $ref: '#/components/responses/400_BadRequest'
          $ref: '#/components/responses/400_BadRequest'
        '409': 
        '409': 
@@ -220,6 +270,11 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, return the UUID of the modified World Anchor.
          description: OK, return the UUID of the modified World Anchor.
          content:
            text/plain:
              schema:
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '400':
        '400':
          $ref: '#/components/responses/400_BadRequest'
          $ref: '#/components/responses/400_BadRequest'
        '404': 
        '404': 
@@ -243,6 +298,11 @@ paths:
                  $ref: "#/components/schemas/WorldAnchor"          
                  $ref: "#/components/schemas/WorldAnchor"          
        '201':
        '201':
          description: Null response.
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
        default:
        default:
          $ref: '#/components/responses/4xx_UnexpectedError'
          $ref: '#/components/responses/4xx_UnexpectedError'


@@ -289,6 +349,11 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, delete successful.
          description: OK, delete successful.
          content:
            text/plain:
              schema:
                type: string
                example: "Element succesfuly deleted"
        '400':
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
          $ref: '#/components/responses/400_InvalidUUID'
        '404':
        '404':
@@ -318,8 +383,14 @@ paths:
            text/plain:
            text/plain:
              schema: 
              schema: 
                type: string
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"            
        '201':
        '201':
          description: Null response
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
        '400':
        '400':
          $ref: '#/components/responses/400_BadRequest'
          $ref: '#/components/responses/400_BadRequest'
        '409': 
        '409': 
@@ -342,6 +413,11 @@ paths:
      responses:
      responses:
        '200':
        '200':
          description: OK, return the UUID of the modified World Link.
          description: OK, return the UUID of the modified World Link.
          content:
            text/plain:
              schema:
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '400':
        '400':
          $ref: '#/components/responses/400_BadRequest'
          $ref: '#/components/responses/400_BadRequest'
        '404': 
        '404': 
@@ -364,7 +440,12 @@ paths:
                items :
                items :
                  $ref: "#/components/schemas/WorldLink"          
                  $ref: "#/components/schemas/WorldLink"          
        '201':
        '201':
          description: Null response
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
        default:
        default:
         $ref: '#/components/responses/4xx_UnexpectedError'
         $ref: '#/components/responses/4xx_UnexpectedError'


@@ -410,7 +491,12 @@ paths:
            format: uuid
            format: uuid
      responses:
      responses:
        '200':
        '200':
          description: OK
          description: OK, delete successful.
          content:
            text/plain:
              schema:
                type: string
                example: "Element succesfully deleted"
        '400':
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
          $ref: '#/components/responses/400_InvalidUUID'
        '404':
        '404':
@@ -619,8 +705,10 @@ components:
        code:
        code:
          type: integer
          type: integer
          format: int32
          format: int32
          example: 406
        message:
        message:
          type: string
          type: string
          example: "Error 406"
          
          
  #-------------------------------
  #-------------------------------
  # Reusable responses
  # Reusable responses
@@ -643,15 +731,35 @@ components:
    #######################
    #######################
    400_BadRequest:
    400_BadRequest:
      description: Bad request.
      description: Bad request.
      content:
        text/plain:
          schema:
            type: string
            example: "Bad request"


    400_InvalidUUID:
    400_InvalidUUID:
      description: Invalid UUID supplied.
      description: Invalid UUID supplied.
      content:
        text/plain:
          schema:
            example: "The format of the UUID is incorrect"
            type: string


    404_NotFoundUUID:
    404_NotFoundUUID:
      description: Not found, could not find UUID in database.
      description: Not found, could not find UUID in database.
      content:
        text/plain:
          schema:
            type: string
            example: "Element not found"


    409_NotEmptyUUID:
    409_NotEmptyUUID:
      description: Invalid UUID, id must be a Nil value.
      description: Invalid UUID, id must be a Nil value.
      content:
        text/plain:
          schema:
            type: string
            example: "The element you sent has already a value and can't be sent to the world storage"


    4xx_UnexpectedError:      # Can be referenced as '#/components/responses/GenericError'
    4xx_UnexpectedError:      # Can be referenced as '#/components/responses/GenericError'
      description: Unexpected error.
      description: Unexpected error.