diff --git a/src/yaml/geojson.yaml b/src/yaml/geojson.yaml index 1ca2550..af45937 100644 --- a/src/yaml/geojson.yaml +++ b/src/yaml/geojson.yaml @@ -2,133 +2,146 @@ openapi: "3.0.1" info: title: Geojson definitions version: 1.0.0 -definitions: - Geometry: - type: object - description: GeoJSon geometry - discriminator: type - required: - - type - externalDocs: - url: http://geojson.org/geojson-spec.html#geometry-objects - properties: - type: - type: string - enum: - - Point - - LineString - - Polygon - - MultiPoint - - MultiLineString - - MultiPolygon - description: the geometry type - - Point2D: - type: array - maxItems: 2 - minItems: 2 - items: - type: number - - Point: - type: object - description: GeoJSon geometry - externalDocs: - url: http://geojson.org/geojson-spec.html#id2 - allOf: - - $ref: "#/definitions/Geometry" - - properties: - coordinates: - $ref: "#/definitions/Point2D" - - LineString: - type: object - description: GeoJSon geometry - externalDocs: - url: http://geojson.org/geojson-spec.html#id3 - allOf: - - $ref: "#/definitions/Geometry" - - properties: - coordinates: - type: array - items: - $ref: "#/definitions/Point2D" - - Polygon: - type: object - description: GeoJSon geometry - externalDocs: - url: http://geojson.org/geojson-spec.html#id4 - allOf: - - $ref: "#/definitions/Geometry" - - properties: - coordinates: - type: array - items: +components: + schemas: + GeometryBase: + type: object + description: GeoJSon geometry + required: + - type + externalDocs: + url: http://geojson.org/geojson-spec.html#geometry-objects + properties: + type: + type: string + enum: + - Point + - LineString + - Polygon + - MultiPoint + - MultiLineString + - MultiPolygon + description: the geometry type + + Geometry: + description: GeoJSon geometry + discriminator: + propertyName: type + type: object + oneOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/LineString' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/MultiPoint' + - $ref: '#/components/schemas/MultiLineString' + - $ref: '#/components/schemas/MultiPolygon' + + Point2D: + type: array + maxItems: 2 + minItems: 2 + items: + type: number + + Point: + type: object + description: GeoJSon geometry + externalDocs: + url: http://geojson.org/geojson-spec.html#id2 + allOf: + - $ref: "#/components/schemas/GeometryBase" + - properties: + coordinates: + $ref: "#/components/schemas/Point2D" + + LineString: + type: object + description: GeoJSon geometry + externalDocs: + url: http://geojson.org/geojson-spec.html#id3 + allOf: + - $ref: "#/components/schemas/GeometryBase" + - properties: + coordinates: type: array items: - $ref: "#/definitions/Point2D" - - MultiPoint: - type: object - description: GeoJSon geometry - externalDocs: - url: http://geojson.org/geojson-spec.html#id5 - allOf: - - $ref: "#/definitions/Geometry" - - properties: - coordinates: - type: array - items: - $ref: "#/definitions/Point2D" - - MultiLineString: - type: object - description: GeoJSon geometry - externalDocs: - url: http://geojson.org/geojson-spec.html#id6 - allOf: - - $ref: "#/definitions/Geometry" - - properties: - coordinates: - type: array - items: + $ref: "#/components/schemas/Point2D" + + Polygon: + type: object + description: GeoJSon geometry + externalDocs: + url: http://geojson.org/geojson-spec.html#id4 + allOf: + - $ref: "#/components/schemas/GeometryBase" + - properties: + coordinates: type: array items: - $ref: "#/definitions/Point2D" - - MultiPolygon: - type: object - description: GeoJSon geometry - externalDocs: - url: http://geojson.org/geojson-spec.html#id6 - allOf: - - $ref: "#/definitions/Geometry" - - properties: - coordinates: - type: array - items: + type: array + items: + $ref: "#/components/schemas/Point2D" + + MultiPoint: + type: object + description: GeoJSon geometry + externalDocs: + url: http://geojson.org/geojson-spec.html#id5 + allOf: + - $ref: "#/components/schemas/GeometryBase" + - properties: + coordinates: + type: array + items: + $ref: "#/components/schemas/Point2D" + + MultiLineString: + type: object + description: GeoJSon geometry + externalDocs: + url: http://geojson.org/geojson-spec.html#id6 + allOf: + - $ref: "#/components/schemas/GeometryBase" + - properties: + coordinates: + type: array + items: + type: array + items: + $ref: "#/components/schemas/Point2D" + + MultiPolygon: + type: object + description: GeoJSon geometry + externalDocs: + url: http://geojson.org/geojson-spec.html#id6 + allOf: + - $ref: "#/components/schemas/GeometryBase" + - properties: + coordinates: type: array items: type: array items: - $ref: "#/definitions/Point2D" - - GeometryCollection: - type: object - description: GeoJSon geometry collection - required: - - type - - geometries - externalDocs: - url: http://geojson.org/geojson-spec.html#geometrycollection - properties: - type: - type: string - enum: - - GeometryCollection - description: - geometries: - type: array - items: - $ref: "#/definitions/Geometry" + type: array + items: + $ref: "#/components/schemas/Point2D" + + GeometryCollection: + type: object + description: GeoJSon geometry collection + required: + - type + - geometries + externalDocs: + url: http://geojson.org/geojson-spec.html#geometrycollection + properties: + type: + type: string + enum: + - GeometryCollection + description: custom properties + geometries: + type: array + items: + $ref: "#/components/schemas/GeometryBase" \ No newline at end of file diff --git a/src/yaml/layerMetadata.yaml b/src/yaml/layerMetadata.yaml index c5b45a5..009b8b4 100644 --- a/src/yaml/layerMetadata.yaml +++ b/src/yaml/layerMetadata.yaml @@ -2,82 +2,83 @@ openapi: "3.0.1" info: title: Layer metadata definitions version: 1.0.0 -definitions: - LayerMetadata: - type: object - description: fdsfs - required: - - source - - sourceName - - version - - updateDate - - resolution - - ep90 - - sensorType - - rms - - scale - - dsc - - fileUris - - geometry - properties: - source: - type: string - description: Layer's unique identifier - version: - type: string - description: layer's version - sourceName: - type: string - description: Name of source - updateDate: - type: string - description: Update date - format: date - resolution: - type: number - description: Resolution of tif files - ep90: - type: number - description: Accuracy - sensorType: - type: string - enum: - - VIS - - RGB - - Pan_Sharpen - - OTHER - description: The sensor type - rms: - type: number - scale: - type: string - dsc: - type: string - fileUris: - type: array - items: +components: + schemas: + LayerMetadata: + type: object + description: layer meta data + required: + - source + - sourceName + - version + - updateDate + - resolution + - ep90 + - sensorType + - rms + - scale + - dsc + - fileUris + - geometry + properties: + source: type: string - geometry: - $ref: geojson.yaml#/definitions/Geometry - StatusLayerMetadata: - type: object - description: Metadata for layer status - required: - - ingestionStartDate - - ingestionEndDate - - layerTileLocation - properties: - allOf: - - $ref: "#/definitions/LayerMetadata" - - properties: - ingestionStartDate: - type: string - format: date - description: Ingestion start time date - ingestionEndDate: - type: string - format: date - description: Ingestion end time date - layerTileLocation: - typr: string - description: Url of tile location + description: Layer's unique identifier + version: + type: string + description: layer's version + sourceName: + type: string + description: Name of source + updateDate: + type: string + description: Update date + format: date + resolution: + type: number + description: Resolution of tif files + ep90: + type: number + description: Accuracy + sensorType: + type: string + enum: + - VIS + - RGB + - Pan_Sharpen + - OTHER + description: The sensor type + rms: + type: number + scale: + type: string + dsc: + type: string + fileUris: + type: array + items: + type: string + geometry: + $ref: geojson.yaml#/components/schemas/Geometry + StatusLayerMetadata: + type: object + description: Metadata for layer status + required: + - ingestionStartDate + - ingestionEndDate + - layerTileLocation + properties: + allOf: + - $ref: "#/components/schemas/LayerMetadata" + - properties: + ingestionStartDate: + type: string + format: date + description: Ingestion start time date + ingestionEndDate: + type: string + format: date + description: Ingestion end time date + layerTileLocation: + typr: string + description: Url of tile location