diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..f07160a2996b6767ec98ce37d266309ef6a3a986 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "arf005"] + path = arf005 + url = https://forge.etsi.org/rep/arf/arf005.git diff --git a/EtsiServerGen/CMakeLists.txt b/EtsiServerGen/CMakeLists.txt index 36945f88b6fb6e2636a42722464cac730e804510..4df5eaec9dbed4d69895b6fe27ecf68fe6d1c02f 100644 --- a/EtsiServerGen/CMakeLists.txt +++ b/EtsiServerGen/CMakeLists.txt @@ -34,5 +34,5 @@ file(GLOB HDRS add_library(${PROJECT_NAME} ${SRCS} ) target_link_libraries(${PROJECT_NAME} pistache pthread) -install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib/worldStorage) -install(FILES ${HDRS} DESTINATION include/worldStorage) +install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib) +install(FILES ${HDRS} DESTINATION include) diff --git a/EtsiServerImpl/src/DefaultApiEtsi.cpp b/EtsiServerImpl/src/DefaultApiEtsi.cpp index 4596b449eb014d1b9211283c6bdfda839fe03285..2ddac9d436450e52b1320432cb3063c64f64ef29 100644 --- a/EtsiServerImpl/src/DefaultApiEtsi.cpp +++ b/EtsiServerImpl/src/DefaultApiEtsi.cpp @@ -11,7 +11,7 @@ DefaultApiEtsi::DefaultApiEtsi(const std::shared_ptr& rt void DefaultApiEtsi::get_version(Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Version 0.0.1\n"); } -void DefaultApiEtsi::ping_get(Pistache::Http::ResponseWriter &response) { +void DefaultApiEtsi::get_ping(Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Server online !\n Have fun\n"); } diff --git a/EtsiServerImpl/src/DefaultApiEtsi.h b/EtsiServerImpl/src/DefaultApiEtsi.h index e51a79918a243b173790c12aa514219c5a6829e8..cfdc4ae741f2bb9645de1d6133753f164aa4a8a4 100644 --- a/EtsiServerImpl/src/DefaultApiEtsi.h +++ b/EtsiServerImpl/src/DefaultApiEtsi.h @@ -19,7 +19,7 @@ public: ~DefaultApiEtsi() override = default; void get_version(Pistache::Http::ResponseWriter &response); - void ping_get(Pistache::Http::ResponseWriter &response); + void get_ping(Pistache::Http::ResponseWriter &response); }; diff --git a/arf005 b/arf005 new file mode 160000 index 0000000000000000000000000000000000000000..5da5faa719bcb310bc57ae97168e582218d1355c --- /dev/null +++ b/arf005 @@ -0,0 +1 @@ +Subproject commit 5da5faa719bcb310bc57ae97168e582218d1355c diff --git a/openapi.yaml b/openapi.yaml deleted file mode 100644 index 434a494ce931238b43fcab9b1acfb190b45859aa..0000000000000000000000000000000000000000 --- a/openapi.yaml +++ /dev/null @@ -1,187 +0,0 @@ -openapi: "3.0.0" -info: - version: 0.0.1 - title: World Storage API - description: API ensuring interoperability between an authoring tool and a World Storage service - license: - name: BSD-3-clause - url: https://opensource.org/licenses/BSD-3-Clause -servers: - - url: http://localhost:8080 -paths: - /ping: - get: - summary: Test the server availability - responses: - '200': - description: OK - /admin: - get: - summary: Get the version of the API - operationId: getVersion - responses: - '200': - description: OK world storage. - content: - text/plain: - schema: - type: string - /trackables: - post: - summary: Create a trackable - operationId: addTrackable - tags: - - trackables - requestBody: - description: the trackable to be added to the world storage - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/trackable' - application/xml: - schema: - $ref: '#/components/schemas/trackable' - responses: - '200': - description: OK returns the UUID of the Trackable defined by the world storage. - content: - text/plain: - schema: - type: string - '201': - description: Null response - default: - description: unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - summary: Deletes a trackable - operationId: deleteTrackable - tags: - - trackables - parameters: - - name: trackableId - in: path - description: trackable id to delete - required: true - schema: - type: string - responses: - '200': - description: OK - '400': - description: Invalid ID supplied - '404': - description: trackable not found - get: - summary: returns the list of all trackables defined by the world storage. - operationId: getTrackables - tags: - - trackables - responses: - 200: - description: OK returns all the Trackables defined by the world storage. - content: - application/json: - schema: - type : array - items : - $ref: "#/components/schemas/trackable" - 201: - description: Null response - default: - description: unexpected error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /trackables/{trackableId}: - get: - summary: Find a trackable by his ID - operationId: getTrackableById - tags: - - trackables - parameters: - - name: trackableId - in: path - description: ID of the trackable to retrieve - required: true - schema: - type: string - responses: - '200': - description: "successful operation" - content: - application/json: - schema: - $ref: '#/components/schemas/trackable' - '400': - description: "Invalid ID supplied" - '404': - description: "Trackable not found" -components: - schemas: - trackable: - type: object - required: - - creatorUID - - trackableType - - trackableEncodingInformation - - trackablePayload - - unitSystem - - trackableDimension - - keyvalueTagList - properties: - creatorUID: - description: A Universally Unique IDentifier identifying the creator of the trackable - type: string - trackableType: - description: Extensible list of trackable types possibly handled by complient World Storage implementation - type: string - enum: [FIDUCIAL_MARKER, IMAGE_MARKER, MAP, OTHER] - trackableEncodingInformation: - description: Identifies targeted framework and version of the format. - $ref: '#/components/schemas/trackableEncodingInformationStructure' - trackablePayload: - description: The data provided to create the trackable in a specific format handled by the World Storage service. - type: string - unitSystem: - description: Unit of length - type: string - enum: [METERS, INCHES] - trackableDimension: - description: Bounding box of the Trackable, {width, length, 0} for 2D trackables, {width, length, depth} for 3D trackables - type: array - items: - type: number - format: double - keyvalueTagList: - description: List of additional parameters to be stored with the trackable. - type: object - additionalProperties: - type: string - trackableEncodingInformationStructure: - required: - - dataFormat - - version - properties: - dataFormat: - description: Identifier of the target framework - type: string - enum: [HOLOLENS, ARKIT, ARCORE] - version: - description: The version of the format - type: string - Error: - required: - - code - - message - properties: - code: - type: integer - format: int32 - message: - type: string diff --git a/package.json b/package.json index 2c70085cdefb9e69b218ab2b64c05dce121c29ea..413e57ac21fe2487e286ba47b703d7ce20d4bc61 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "ISG ARF World Storage Cpp Server", "main": "index.js", "scripts": { - "generate": "cd EtsiServerGen && npx @openapitools/openapi-generator-cli generate -i ../openapi.yaml -g cpp-pistache-server -o .", + "generate": "cd EtsiServerGen && npx @openapitools/openapi-generator-cli generate -i ../arf005/API/openapi.yaml -g cpp-pistache-server -o .", "dependencies": "cp -a ./nlohmann ./EtsiServerGen/model && sudo add-apt-repository ppa:pistache+team/unstable && sudo apt update && sudo apt install libpistache-dev", "build": "cd EtsiServerGen && mkdir -p build && cd build && cmake .. && sudo make install" },