Skip to content

Commit

Permalink
Merge pull request #315 from tlohmar/main
Browse files Browse the repository at this point in the history
Common 'area' data-type
  • Loading branch information
rartych authored Nov 27, 2024
2 parents 7401b48 + c416430 commit f157941
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions artifacts/CAMARA_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,94 @@ components:
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 intersect 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:
description: Bad Request
Expand Down

0 comments on commit f157941

Please sign in to comment.