From 3701610f65e40da98dedfb99f5fc9c06aabdc76b Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 11 Oct 2024 11:45:47 +0200 Subject: [PATCH 1/3] Inserting a copy of the 'area' data-type, obtained from the location-retrieval API (Device Location). Adding a consideration on self-intersecting polygons --- artifacts/CAMARA_common.yaml | 88 ++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/artifacts/CAMARA_common.yaml b/artifacts/CAMARA_common.yaml index 62504590..2d94fb83 100644 --- a/artifacts/CAMARA_common.yaml +++ b/artifacts/CAMARA_common.yaml @@ -126,6 +126,94 @@ components: type: string format: ipv6 example: 2001:db8:85a3:8d3:1319:8a2e:370:7344 + + Area: + description: Base schema for all areas + type: object + properties: + areaType: + $ref: "#/components/schemas/AreaType" + required: + - areaType + discriminator: + propertyName: areaType + mapping: + CIRCLE: "#/components/schemas/Circle" + POLYGON: "#/components/schemas/Polygon" + + AreaType: + type: string + description: | + Type of this area. + CIRCLE - The area is defined as a circle. + POLYGON - The area is defined as a polygon. + enum: + - CIRCLE + - POLYGON + + Circle: + description: Circular area + allOf: + - $ref: "#/components/schemas/Area" + - type: object + required: + - center + - radius + properties: + center: + $ref: "#/components/schemas/Point" + radius: + type: number + description: Distance from the center in meters + minimum: 1 + + Polygon: + description: Polygonal area. The Polygon should be a simple polygon, i.e. should not intersection itself. + allOf: + - $ref: "#/components/schemas/Area" + - type: object + required: + - boundary + properties: + boundary: + $ref: "#/components/schemas/PointList" + + PointList: + description: List of points defining a polygon + type: array + items: + $ref: "#/components/schemas/Point" + minItems: 3 + maxItems: 15 + + Point: + type: object + description: Coordinates (latitude, longitude) defining a location in a map + required: + - latitude + - longitude + properties: + latitude: + $ref: "#/components/schemas/Latitude" + longitude: + $ref: "#/components/schemas/Longitude" + example: + latitude: 50.735851 + longitude: 7.10066 + + Latitude: + description: Latitude component of a location + type: number + format: double + minimum: -90 + maximum: 90 + + Longitude: + description: Longitude component of location + type: number + format: double + minimum: -180 + maximum: 180 responses: Generic400: From 4fdd4f8a4ac14c89b05dc1b497e88ccc7c605ea7 Mon Sep 17 00:00:00 2001 From: Rafal Artych <121048129+rartych@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:54:45 +0100 Subject: [PATCH 2/3] Update CAMARA_common.yaml - trailing spaces --- artifacts/CAMARA_common.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/CAMARA_common.yaml b/artifacts/CAMARA_common.yaml index 2d94fb83..8fd3193d 100644 --- a/artifacts/CAMARA_common.yaml +++ b/artifacts/CAMARA_common.yaml @@ -126,7 +126,7 @@ components: type: string format: ipv6 example: 2001:db8:85a3:8d3:1319:8a2e:370:7344 - + Area: description: Base schema for all areas type: object From c41643003dd55023522e7eaeabc540324c87515f Mon Sep 17 00:00:00 2001 From: Rafal Artych <121048129+rartych@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:56:26 +0100 Subject: [PATCH 3/3] Update CAMARA_common.yaml Typo fixed --- artifacts/CAMARA_common.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/CAMARA_common.yaml b/artifacts/CAMARA_common.yaml index 8fd3193d..262fb4fd 100644 --- a/artifacts/CAMARA_common.yaml +++ b/artifacts/CAMARA_common.yaml @@ -168,7 +168,7 @@ components: minimum: 1 Polygon: - description: Polygonal area. The Polygon should be a simple polygon, i.e. should not intersection itself. + description: Polygonal area. The Polygon should be a simple polygon, i.e. should not intersect itself. allOf: - $ref: "#/components/schemas/Area" - type: object