openapi.yaml 24.9 KB
Newer Older
# Copyright 2022 ETSI. Licensed under the BSD-3-Clause license
# API for the Augmented Reality Framework (ARF)
# Working group: ETSI ISG ARF
# STF group: STF620 (validation)
#
# References:
# - Explaination UUID: https://en.wikipedia.org/wiki/Universally_unique_identifier / https://fr.wikipedia.org/wiki/Universally_unique_identifier
# - UUID formats: 8-4-4-4-12 format string, lower case (but case insensitive on input) 
# - UUID RFC4122: https://datatracker.ietf.org/doc/html/rfc4122#section-3
Sylvain Renault's avatar
Sylvain Renault committed
# - online UUID generator: https://www.uuidgenerator.net/
# - Rules for RESTful error code RFC2616: https://datatracker.ietf.org/doc/html/rfc2616#section-10
# - Guide: https://restfulapi.net/http-status-codes/
#
Sylvain Renault's avatar
Sylvain Renault committed
# Last Version: 01.06.2022

openapi: "3.0.0"

Nathan Chambron's avatar
Nathan Chambron committed
info: 
  version: 1.0.0
Nathan Chambron's avatar
Nathan Chambron committed
  title: World Storage API
  description: API ensuring interoperability between an authoring tool and a World Storage service
  license:
    name: Copyright 2022 ETSI. Licensed under the BSD-3-Clause license
Nathan Chambron's avatar
Nathan Chambron committed
    url: https://opensource.org/licenses/BSD-3-Clause
servers:
  - url: http://localhost:8080
  
tags:
  - name: default
    description: Default operations to test the current server's state
  - name: Trackables
    description: Trackables are models of parts of the real world. <br>Trackables are elements of the real world of which features are available and/or could be extracted.<br> Trackables provide a Coordinate Reference System in which a pose can be expressed.
  - name: World Anchors
    description: A World Anchor represents a fixed position in relation to one or more elements of the real world. <br>It has a Coordinate Reference System in which AR Assets stay spatially-registered. 
  - name: World Links
    description: A World Link represents and defines the relative 3D position and orientation between elements (Trackables and/or World Anchors).
  
Nathan Chambron's avatar
Nathan Chambron committed
paths:
  /ping:
    get:
Sylvain Renault's avatar
Sylvain Renault committed
      summary: Test the server availability.
      operationId: getPing
Nathan Chambron's avatar
Nathan Chambron committed
      responses:
        '200':
Sylvain Renault's avatar
Sylvain Renault committed
          description: Ok, returns a string message.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: "pong"
Nathan Chambron's avatar
Nathan Chambron committed
  /admin:
    get:
      summary: Get the state of the server.
      operationId: getAdmin
      responses:
        '200':
Nathan Chambron's avatar
Nathan Chambron committed
          description: OK, world storage server ready.
          content:
            text/plain:
              schema:
                type: string
                example: "Server up and running"
  /version:
    get:
      summary: Get the version of the ARF API.
Nathan Chambron's avatar
Nathan Chambron committed
      operationId: getVersion
      responses:
        '200':
Nathan Chambron's avatar
Nathan Chambron committed
          description: Current version.
          content:
            text/plain:
              schema:
                type: string
                example: "1.0.0"

##############
# TRACKABLES #
##############
Nathan Chambron's avatar
Nathan Chambron committed
  /trackables:
    post:
      summary: Create a Trackable.
Nathan Chambron's avatar
Nathan Chambron committed
      operationId: addTrackable
      description: Create a new Trackable from a json object containing all the required informations and add it to the world storage. <br>As a result you will get the ID of the newly created Trackable.
Nathan Chambron's avatar
Nathan Chambron committed
      tags:
        - Trackables
Nathan Chambron's avatar
Nathan Chambron committed
      requestBody:
          description: The Trackable to be added to the world storage.
Nathan Chambron's avatar
Nathan Chambron committed
          required: true
          content:
            application/json:
              schema:
Eric Villain's avatar
Eric Villain committed
                $ref: '#/components/schemas/Trackable'
Nathan Chambron's avatar
Nathan Chambron committed
      responses:
        '200':
Nathan Chambron's avatar
Nathan Chambron committed
          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"
Nathan Chambron's avatar
Nathan Chambron committed
        '201':
          description: Null response.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: ""
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '409': 
          $ref: '#/components/responses/409_NotEmptyUUID'
        'default':
          $ref: '#/components/responses/4xx_UnexpectedError'
    put:
      summary: Modify a Trackable.
      operationId: modifyTrackable
      description: Modify an existing Trackable given a json object containing all the required informations. <br> **Please note that ID of the object is required in the JSON**
      tags:
        - Trackables
      requestBody:
          description: The Trackable to be modified in the world storage.
          required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trackable'
      responses:
        '200':
          description: OK, return the UUID of the modified Trackable.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '404': 
          $ref: '#/components/responses/404_NotFoundUUID'
        'default':
          $ref: '#/components/responses/4xx_UnexpectedError'
Nathan Chambron's avatar
Nathan Chambron committed
    get:
      summary: Return all the Trackables.
Nathan Chambron's avatar
Nathan Chambron committed
      operationId: getTrackables
      description: Get all the Trackables currently being stored in the world storage.
Nathan Chambron's avatar
Nathan Chambron committed
      tags:
        - Trackables
Nathan Chambron's avatar
Nathan Chambron committed
      responses:
          description: OK, return all the Trackables defined by the world storage.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            application/json:
              schema:
                type : array
                items :
Eric Villain's avatar
Eric Villain committed
                  $ref: "#/components/schemas/Trackable"          
          description: Null response.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: ""
Nathan Chambron's avatar
Nathan Chambron committed
        default:
          $ref: '#/components/responses/4xx_UnexpectedError'

  /trackables/{trackableUUID}:
Nathan Chambron's avatar
Nathan Chambron committed
    get:
      summary: Find a Trackable by its UUID.
Nathan Chambron's avatar
Nathan Chambron committed
      operationId: getTrackableById
      description: Get a single Trackable stored in the world storage from its ID.
Nathan Chambron's avatar
Nathan Chambron committed
      tags:
      - Trackables
Nathan Chambron's avatar
Nathan Chambron committed
      parameters:
        - name: trackableUUID
Nathan Chambron's avatar
Nathan Chambron committed
          in: path
          description: UUID of the Trackable to retrieve.
Nathan Chambron's avatar
Nathan Chambron committed
          required: true
          schema:
            type: string
            format: uuid
Nathan Chambron's avatar
Nathan Chambron committed
      responses:
        '200':
          description: Successful operation.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            application/json:
              schema:
Eric Villain's avatar
Eric Villain committed
                $ref: '#/components/schemas/Trackable' 
Nathan Chambron's avatar
Nathan Chambron committed
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
Nathan Chambron's avatar
Nathan Chambron committed
        '404':
          $ref: '#/components/responses/404_NotFoundUUID'
      summary: Delete a Trackable.
      operationId: deleteTrackable
      description: Delete a single Trackable stored in the world storage from its ID.
      - Trackables
        - name: trackableUUID
          description: Trackable UUID to delete.
          required: true
          schema:
            type: string
            format: uuid
          description: OK, delete successful.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: "Element succesfully deleted"
          $ref: '#/components/responses/400_InvalidUUID'
          $ref: '#/components/responses/404_NotFoundUUID'   

#################
# WORLD ANCHORS #
#################
Eric Villain's avatar
Eric Villain committed
  /worldAnchors:
    post:
      summary: Create a World Anchor.
Eric Villain's avatar
Eric Villain committed
      operationId: addWorldAnchor
      description: Create a new World Anchor from a json object containing all the required informations and add it to the world storage. <br>As a result you will get the ID of the newly created World Anchor.
Eric Villain's avatar
Eric Villain committed
      tags:
        - World Anchors
Eric Villain's avatar
Eric Villain committed
      requestBody:
          description: The World Anchor to be added to the world storage.
Eric Villain's avatar
Eric Villain committed
          required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorldAnchor'
Eric Villain's avatar
Eric Villain committed
      responses:
        '200':
Nathan Chambron's avatar
Nathan Chambron committed
          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"
Eric Villain's avatar
Eric Villain committed
        '201':
          description: Null response.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: ""
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '409': 
          $ref: '#/components/responses/409_NotEmptyUUID'
        'default':
          $ref: '#/components/responses/4xx_UnexpectedError'
    put:
      summary: Modify a World Anchor.
      operationId: modifyWorldAnchor
      description: Modify an existing World Anchor given a json object containing all the required informations. <br> **Please note that ID of the object is required in the JSON**
      tags:
        - World Anchors
      requestBody:
          description: The World Anchor to be modified in the world storage.
          required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorldAnchor'
      responses:
        '200':
          description: OK, return the UUID of the modified World Anchor.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '404': 
          $ref: '#/components/responses/404_NotFoundUUID'
        'default':
          $ref: '#/components/responses/4xx_UnexpectedError'
Eric Villain's avatar
Eric Villain committed
    get:
      summary: Return all the World Anchors.
Eric Villain's avatar
Eric Villain committed
      operationId: getWorldAnchors
      description: Get all the World Anchors currently being stored in the world storage.
Eric Villain's avatar
Eric Villain committed
      tags:
        - World Anchors
Eric Villain's avatar
Eric Villain committed
      responses:
        '200':
          description: OK, return all the World Anchors defined by the world storage.
Eric Villain's avatar
Eric Villain committed
          content:
            application/json:
              schema:
                type : array
                items :
                  $ref: "#/components/schemas/WorldAnchor"          
        '201':
          description: Null response.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: ""
Eric Villain's avatar
Eric Villain committed
        default:
          $ref: '#/components/responses/4xx_UnexpectedError'

  /worldAnchors/{worldAnchorUUID}:
Eric Villain's avatar
Eric Villain committed
    get:
      summary: Find a World Anchor by its UUID.
Eric Villain's avatar
Eric Villain committed
      operationId: getWorldAnchorById
      description: Get a single World Anchor stored in the world storage from its ID.
Eric Villain's avatar
Eric Villain committed
      tags:
      - World Anchors
Eric Villain's avatar
Eric Villain committed
      parameters:
        - name: worldAnchorUUID
Eric Villain's avatar
Eric Villain committed
          in: path
          description: UUID of the World Anchor to retrieve.
Eric Villain's avatar
Eric Villain committed
          required: true
          schema:
            type: string
            format: uuid
Eric Villain's avatar
Eric Villain committed
      responses:
        '200':
          description: Successful operation.
Eric Villain's avatar
Eric Villain committed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorldAnchor' 
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
Eric Villain's avatar
Eric Villain committed
        '404':
          $ref: '#/components/responses/404_NotFoundUUID'
Eric Villain's avatar
Eric Villain committed
    delete:
      summary: Delete a World Anchor.
Eric Villain's avatar
Eric Villain committed
      operationId: deleteWorldAnchor
      description: Delete a single World Anchor stored in the world storage from its ID.
Eric Villain's avatar
Eric Villain committed
      tags:
      - World Anchors
Eric Villain's avatar
Eric Villain committed
      parameters:
        - name: worldAnchorUUID
Eric Villain's avatar
Eric Villain committed
          in: path
          description: World Anchor UUID to delete.
Eric Villain's avatar
Eric Villain committed
          required: true
          schema:
            type: string
            format: uuid
Eric Villain's avatar
Eric Villain committed
      responses:
        '200':
          description: OK, delete successful.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: "Element succesfuly deleted"
Eric Villain's avatar
Eric Villain committed
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
Eric Villain's avatar
Eric Villain committed
        '404':
          $ref: '#/components/responses/404_NotFoundUUID'   

###############
# WORLD LINKS #
###############
Eric Villain's avatar
Eric Villain committed
  /worldLinks:
    post:
      summary: Create a World Link between elements (world anchors and/or trackables).
Eric Villain's avatar
Eric Villain committed
      operationId: addWorldLink
      description: Create a new World Link from a json object containing all the required informations and add it to the world storage. <br>As a result you will get the ID of the newly created World Link.
Eric Villain's avatar
Eric Villain committed
      tags:
        - World Links
Eric Villain's avatar
Eric Villain committed
      requestBody:
          description: The link to be added to the world storage.
Eric Villain's avatar
Eric Villain committed
          required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorldLink'
      responses:
        '200':
          description: OK, return the UUID of the World Link defined by the world storage.
Eric Villain's avatar
Eric Villain committed
          content:
            text/plain:
              schema: 
Nathan Chambron's avatar
Nathan Chambron committed
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"            
Eric Villain's avatar
Eric Villain committed
        '201':
Nathan Chambron's avatar
Nathan Chambron committed
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '409': 
          $ref: '#/components/responses/409_NotEmptyUUID'
        'default':
          $ref: '#/components/responses/4xx_UnexpectedError'
    put:
      summary: Modify a World Link.
      operationId: modifyWorldLink
      description: Modify an existing World Link given a json object containing all the required informations. <br> **Please note that ID of the object is required in the JSON**
      tags:
        - World Links
      requestBody:
          description: The World Link to be modified in the world storage.
          required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorldLink'
      responses:
        '200':
          description: OK, return the UUID of the modified World Link.
Nathan Chambron's avatar
Nathan Chambron committed
          content:
            text/plain:
              schema:
                type: string
                example: "777266da-e286-11ec-8fea-0242ac120002"
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '404': 
          $ref: '#/components/responses/404_NotFoundUUID'
        'default':
          $ref: '#/components/responses/4xx_UnexpectedError'
Eric Villain's avatar
Eric Villain committed
    get:
      summary: Return all World Links.
      description: Get all the World Links currently being stored in the world storage.
Eric Villain's avatar
Eric Villain committed
      operationId: getWorldLinks
      tags:
        - World Links
Eric Villain's avatar
Eric Villain committed
      responses:
        '200':
          description: OK return all the World Links defined by the world storage.
Eric Villain's avatar
Eric Villain committed
          content:
            application/json:
              schema:
                type : array
                items :
                  $ref: "#/components/schemas/WorldLink"          
        '201':
Nathan Chambron's avatar
Nathan Chambron committed
          description: Null response.
          content:
            text/plain:
              schema:
                type: string
                example: ""
Eric Villain's avatar
Eric Villain committed
        default:
         $ref: '#/components/responses/4xx_UnexpectedError'

  /worldLinks/{worldLinkUUID}:
Eric Villain's avatar
Eric Villain committed
    get:
      summary: Find a World Link by its UUID.
Eric Villain's avatar
Eric Villain committed
      operationId: getWorldLinkById
      description: Get a single World Link stored in the world storage from its ID.
Eric Villain's avatar
Eric Villain committed
      tags:
      - World Links
Eric Villain's avatar
Eric Villain committed
      parameters:
        - name: worldLinkUUID
Eric Villain's avatar
Eric Villain committed
          in: path
          description: UUID of the World Link to retrieve.
Eric Villain's avatar
Eric Villain committed
          required: true
          schema:
            type: string
            format: uuid
Eric Villain's avatar
Eric Villain committed
      responses:
        '200':
          description: Successful operation.
Eric Villain's avatar
Eric Villain committed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorldLink' 
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
Eric Villain's avatar
Eric Villain committed
        '404':
          $ref: '#/components/responses/404_NotFoundUUID'
Eric Villain's avatar
Eric Villain committed
    delete:
      summary: Delete a World Link.
Eric Villain's avatar
Eric Villain committed
      operationId: deleteWorldLink
      description: Delete a single World Link stored in the world storage from its ID.
Eric Villain's avatar
Eric Villain committed
      tags:
      - World Links
Eric Villain's avatar
Eric Villain committed
      parameters:
        - name: worldLinkUUID
Eric Villain's avatar
Eric Villain committed
          in: path
          description: World Link id to delete.
Eric Villain's avatar
Eric Villain committed
          required: true
          schema:
            type: string
            format: uuid
Eric Villain's avatar
Eric Villain committed
      responses:
        '200':
Nathan Chambron's avatar
Nathan Chambron committed
          description: OK, delete successful.
          content:
            text/plain:
              schema:
                type: string
                example: "Element succesfully deleted"
Eric Villain's avatar
Eric Villain committed
        '400':
          $ref: '#/components/responses/400_InvalidUUID'
        '404':
         $ref: '#/components/responses/404_NotFoundUUID'
 
# COMPONENTS ###############################################
Nathan Chambron's avatar
Nathan Chambron committed
components:

  #-------------------------------
  # Reusable schemas (data models)
  #-------------------------------
Nathan Chambron's avatar
Nathan Chambron committed
  schemas:
Eric Villain's avatar
Eric Villain committed
    Trackable:
      description: An element representing a Trackable object in the real world.
Nathan Chambron's avatar
Nathan Chambron committed
      type: object
      required:
Nathan Chambron's avatar
Nathan Chambron committed
        - trackableType
        - trackableEncodingInformation
        - trackablePayload
Eric Villain's avatar
Eric Villain committed
        - unit
Nathan Chambron's avatar
Nathan Chambron committed
      properties:
          description: An Universally Unique IDentifier identifying the Trackable (RFC 4122).
          type: string
          format: uuid
          example: fa8bbe40-8052-11ec-a8a3-0242ac120002
          description: A human readable name for the Trackable.
          example: myTrackableXYZ
          description: An Universally Unique IDentifier identifying the creator of the Trackable (a person, a team or a company).
Nathan Chambron's avatar
Nathan Chambron committed
          type: string
          format: uuid
Sylvain Renault's avatar
Sylvain Renault committed
          example: bd6ce7ce-7fe8-487d-a179-fddfe914f293
Nathan Chambron's avatar
Nathan Chambron committed
        trackableType:
          description: Extensible list of Trackable types, possibly handled by complient world storage implementation.
Nathan Chambron's avatar
Nathan Chambron committed
          type: string
          enum: [FIDUCIAL_MARKER, IMAGE_MARKER, MAP, GEOPOSE, OTHER]
Nathan Chambron's avatar
Nathan Chambron committed
          example: FIDUCIAL_MARKER
        trackableEncodingInformation:         
Eric Villain's avatar
Eric Villain committed
          $ref: '#/components/schemas/EncodingInformationStructure'
Nathan Chambron's avatar
Nathan Chambron committed
        trackablePayload:
          description: The data provided to create the Trackable in a specific format handled by the world storage service.
Nathan Chambron's avatar
Nathan Chambron committed
          type: string
          format: byte
          example: "10110101"
        localCRS:
          $ref: '#/components/schemas/Transform3D'
Eric Villain's avatar
Eric Villain committed
        unit:
          $ref: '#/components/schemas/UnitSystem'
          $ref: '#/components/schemas/Size'
Eric Villain's avatar
Eric Villain committed
        keyvalueTags:
          $ref: '#/components/schemas/KeyvalueTagList'
    WorldAnchor:
Sylvain Renault's avatar
Sylvain Renault committed
      description: An element describing a pose in the world graph.
Eric Villain's avatar
Eric Villain committed
      type: object
      required:
Eric Villain's avatar
Eric Villain committed
        - localCRS
        - unit
        - worldAnchorSize
Nathan Chambron's avatar
Nathan Chambron committed
        - keyvalueTags
Eric Villain's avatar
Eric Villain committed
      properties:
          description: An Universally Unique IDentifier identifying the World Anchor (RFC 4122).
Eric Villain's avatar
Eric Villain committed
          type: string
          format: uuid
Sylvain Renault's avatar
Sylvain Renault committed
          example: 49d18ab3-1bf8-481d-919b-cd062a2fd428
          description: A human readable name for the World Anchor.
          example: myWorldAnchorXYZ
          description: An Universally Unique IDentifier identifying the creator of the World Anchor.
Eric Villain's avatar
Eric Villain committed
          type: string
          format: uuid
Sylvain Renault's avatar
Sylvain Renault committed
          example: 6ddeb59e-7740-42f7-b329-1374b92e7fc2
Eric Villain's avatar
Eric Villain committed
        localCRS:
          $ref: '#/components/schemas/Transform3D'
Eric Villain's avatar
Eric Villain committed
        unit:
          $ref: '#/components/schemas/UnitSystem'
          $ref: '#/components/schemas/Size'
Eric Villain's avatar
Eric Villain committed
        keyvalueTags:
          $ref: '#/components/schemas/KeyvalueTagList'
Eric Villain's avatar
Eric Villain committed
    WorldLink:
Sylvain Renault's avatar
Sylvain Renault committed
      description: An object holding the info of a transform between two elements.
Eric Villain's avatar
Eric Villain committed
      type: object
      required:
        - creatorUUID
        - UUIDFrom
        - UUIDTo
Eric Villain's avatar
Eric Villain committed
        - unit
        - keyvalueTags
      properties:
          description: An Universally Unique IDentifier identifying the World Link (RFC 4122).
Eric Villain's avatar
Eric Villain committed
          type: string
          format: uuid
Sylvain Renault's avatar
Sylvain Renault committed
          example: c6998f4f-1b8d-460b-9de8-4793b92fae2a
          description: An Universally Unique IDentifier identifying the creator of the World Link.
Eric Villain's avatar
Eric Villain committed
          type: string
          format: uuid
Sylvain Renault's avatar
Sylvain Renault committed
          example: 7506001c-9c00-4f84-ae2e-e4dfcb77d36a
          description: An Universally Unique IDentifier identifying a World Anchor or Trackable.
Eric Villain's avatar
Eric Villain committed
          type: string
          format: uuid
Sylvain Renault's avatar
Sylvain Renault committed
          example: 60e11d81-1230-4588-be4c-93520a275012
          description: An Universally Unique IDentifier identifying a World Anchor or Trackable.
Eric Villain's avatar
Eric Villain committed
          type: string
          format: uuid
Sylvain Renault's avatar
Sylvain Renault committed
          example: 85eed503-875c-4d3d-9569-06c4859bd4cd
        typeFrom:
          $ref: '#/components/schemas/ObjectType'
        typeTo:
          $ref: '#/components/schemas/ObjectType'
          $ref: '#/components/schemas/Transform3D'
Eric Villain's avatar
Eric Villain committed
        unit:
          $ref: '#/components/schemas/UnitSystem'
Eric Villain's avatar
Eric Villain committed
        keyvalueTags:
          $ref: '#/components/schemas/KeyvalueTagList'
Eric Villain's avatar
Eric Villain committed
    EncodingInformationStructure:
      description: An object holding the info of a Trackable`'`s encoding informations `:` the data format and the version.
Nathan Chambron's avatar
Nathan Chambron committed
      required:
        - dataFormat
        - version
      properties:
        dataFormat:
Sylvain Renault's avatar
Sylvain Renault committed
          description: Identifier of the target framework.
Nathan Chambron's avatar
Nathan Chambron committed
          type: string
          enum: [HOLOLENS, ARKIT, ARCORE, VUFORIA, ARUCO, OTHER]
Nathan Chambron's avatar
Nathan Chambron committed
          example : "HOLOLENS"
        version:
          description: The version of the format
          type: string
          example : "1.01"
Sylvain Renault's avatar
Sylvain Renault committed
        description: Coordinate reference system of the world anchor, a 4*4 matrix (rowmajor) represented by a float vector.
Eric Villain's avatar
Eric Villain committed
        type: array
        minItems: 16
        maxItems: 16
        items:
          type: number
          format: float
Sylvain Renault's avatar
Sylvain Renault committed
        example: [ 1, 0, 0, 3,
                   0, 1, 0, 3,
                   0, 0, 1, 3,
                   0, 0, 0, 1]

    ObjectType:
Sylvain Renault's avatar
Sylvain Renault committed
        description: Type of a world representaion object.
        type: string
Sylvain Renault's avatar
Sylvain Renault committed
        enum: [Trackable, WorldAnchor, NotIdentified]
        example: Trackable

Eric Villain's avatar
Eric Villain committed
    UnitSystem:
        description: Unit of length.
Eric Villain's avatar
Eric Villain committed
        type: string
        enum: [MM,  CM,  DM,  M,  DAM,  HM,  KM,  INCH, FOOT, YARD, MILE]
        description: Size object in format {width, length, depth}.
Eric Villain's avatar
Eric Villain committed
        type: array
        items:
            type: number
            format: double
        minItems: 3
        maxItems: 3
Sylvain Renault's avatar
Sylvain Renault committed
        example: [1.0,1.0,1.5]   
Eric Villain's avatar
Eric Villain committed
    KeyvalueTagList:   
        description: List of additional parameters to be stored with the object.
Eric Villain's avatar
Eric Villain committed
        type: object
        additionalProperties:
            type: array
            items:
                type: string
            minItems: 1
Sylvain Renault's avatar
Sylvain Renault committed
        example: { "Place" : ["Building 123"], "Room" : ["007"]} 
Nathan Chambron's avatar
Nathan Chambron committed
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
Nathan Chambron's avatar
Nathan Chambron committed
          example: 406
Nathan Chambron's avatar
Nathan Chambron committed
        message:
Eric Villain's avatar
Eric Villain committed
          type: string
Nathan Chambron's avatar
Nathan Chambron committed
          example: "Error 406"
  #-------------------------------
  # Reusable responses
  #-------------------------------
  responses:
    #######################
    # 1xx : Informational #
    #######################

    #################
    # 2xx : Success #
    #################

    #####################
    # 3xx : Redirection #
    #####################

    #######################
    # 4xx : Client Errors #
    #######################
    400_BadRequest:
      description: Bad request.
Nathan Chambron's avatar
Nathan Chambron committed
      content:
        text/plain:
          schema:
            type: string
            example: "Bad request"

    400_InvalidUUID:
      description: Invalid UUID supplied.
Nathan Chambron's avatar
Nathan Chambron committed
      content:
        text/plain:
          schema:
            example: "The format of the UUID is incorrect"
            type: string

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

    409_NotEmptyUUID:
      description: Invalid UUID, id must be a Nil value.
Nathan Chambron's avatar
Nathan Chambron committed
      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'
      description: Unexpected error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

    ########################
    # 5xx : Server Errors  #
    ########################
    5xx_UnexpectedError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'