Skip to content
Snippets Groups Projects
Commit d961c56e authored by Nathan Chambron's avatar Nathan Chambron
Browse files

Merge branch 'feature/newApiSpecs' into 'develop'

Feature/new api specs

See merge request !3
parents 2f9558de 5a3364c0
No related branches found
No related tags found
2 merge requests!3Feature/new api specs,!2Develop
[submodule "arf005"]
path = arf005
url = https://forge.etsi.org/rep/arf/arf005.git
...@@ -34,5 +34,5 @@ file(GLOB HDRS ...@@ -34,5 +34,5 @@ file(GLOB HDRS
add_library(${PROJECT_NAME} ${SRCS} ) add_library(${PROJECT_NAME} ${SRCS} )
target_link_libraries(${PROJECT_NAME} pistache pthread) target_link_libraries(${PROJECT_NAME} pistache pthread)
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib/worldStorage) install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib)
install(FILES ${HDRS} DESTINATION include/worldStorage) install(FILES ${HDRS} DESTINATION include)
...@@ -11,7 +11,7 @@ DefaultApiEtsi::DefaultApiEtsi(const std::shared_ptr<Pistache::Rest::Router>& rt ...@@ -11,7 +11,7 @@ DefaultApiEtsi::DefaultApiEtsi(const std::shared_ptr<Pistache::Rest::Router>& rt
void DefaultApiEtsi::get_version(Pistache::Http::ResponseWriter &response) { void DefaultApiEtsi::get_version(Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Version 0.0.1\n"); 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"); response.send(Pistache::Http::Code::Ok, "Server online !\n Have fun\n");
} }
......
...@@ -19,7 +19,7 @@ public: ...@@ -19,7 +19,7 @@ public:
~DefaultApiEtsi() override = default; ~DefaultApiEtsi() override = default;
void get_version(Pistache::Http::ResponseWriter &response); void get_version(Pistache::Http::ResponseWriter &response);
void ping_get(Pistache::Http::ResponseWriter &response); void get_ping(Pistache::Http::ResponseWriter &response);
}; };
......
arf005 @ 5da5faa7
Subproject commit 5da5faa719bcb310bc57ae97168e582218d1355c
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
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "ISG ARF World Storage Cpp Server", "description": "ISG ARF World Storage Cpp Server",
"main": "index.js", "main": "index.js",
"scripts": { "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", "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" "build": "cd EtsiServerGen && mkdir -p build && cd build && cmake .. && sudo make install"
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment