diff --git a/examples/autonomy_engine_adapter/planning_configuration.json b/examples/autonomy_engine_adapter/planning_configuration.json index fccf3344292e6c70a4c202c9dd1d2689c6f6b56b..222c3f4a6ece9ac2ddc7ee2c24a8ba98ed5487c5 100644 --- a/examples/autonomy_engine_adapter/planning_configuration.json +++ b/examples/autonomy_engine_adapter/planning_configuration.json @@ -13,64 +13,60 @@ "planning_config_ID": 1, "exclusion_zones": [ { - "geometry": { - "type": "Polygon", - "coordinates": [ + "type": "Polygon", + "coordinates": [ + [ [ - [ - -4.1777839187560915, - 50.34173405662855 - ], - [ - -4.1777839187560915, - 50.33820949229701 - ], - [ - -4.143667777943875, - 50.33820949229701 - ], - [ - -4.143667777943875, - 50.34173405662855 - ], - [ - -4.1777839187560915, - 50.34173405662855 - ] + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 ] ] - } + ] } ], "region_of_interest": [ { - "geometry": { - "type": "Polygon", - "coordinates": [ + "type": "Polygon", + "coordinates": [ + [ [ - [ - -4.1777839187560915, - 50.34173405662855 - ], - [ - -4.1777839187560915, - 50.33820949229701 - ], - [ - -4.143667777943875, - 50.33820949229701 - ], - [ - -4.143667777943875, - 50.34173405662855 - ], - [ - -4.1777839187560915, - 50.34173405662855 - ] + -4.1777839187560915, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.33820949229701 + ], + [ + -4.143667777943875, + 50.34173405662855 + ], + [ + -4.1777839187560915, + 50.34173405662855 ] ] - } + ] } ], "squads": [ diff --git a/formats/planning_configuration.py b/formats/planning_configuration.py index a7adf71730cccabfe592cc4673fc7827e2cdbf4c..53a44d697c4a7ae72c1a36aebb456db335f4868c 100644 --- a/formats/planning_configuration.py +++ b/formats/planning_configuration.py @@ -34,7 +34,8 @@ emergency_schema = { }, }, "required": [ - "target_waypoint", + "target_waypoint_latitude", + "target_waypoint_longitude", ], } diff --git a/generate_schema_config.py b/generate_schema_config.py index d6c2115750afb54c675ff3a129bfe94e1d2667a5..1bd34c6884d8040de26c71bfb53560dfe19cdb01 100644 --- a/generate_schema_config.py +++ b/generate_schema_config.py @@ -30,88 +30,92 @@ FLASK_PORT = os.getenv("FLASK_PORT", 5000) # Switch on debug mode if env var is truthy FLASK_DEBUG = os.getenv("FLASK_DEBUG", "False").lower() in ("true", "1", "t") -swagger_config = { - "openapi": "3.0.2", - "swagger_ui": True, - "specs_route": "/", - "info": { - "title": "SoAR Backbone Message Formats", - "version": "1.0", - "description": "SoAR message protocol in schemas", - }, - "specs": [ - { - "endpoint": "swagger", - "route": "/soar_protocol.json", - } - ], - "url_prefix": URL_PREFIX, - "paths": {}, - "components": { - "schemas": { - "MESSAGE": { - "type": "object", - "description": "Full message definition with" - + " message-metadata in `header` and different" - + " message type schemas under `payload`", - "properties": { - "header": { - "$ref": "#/components/schemas/header", + +def get_swagger_config(): + swagger_config = { + "openapi": "3.0.2", + "swagger_ui": True, + "specs_route": "/", + "info": { + "title": "SoAR Backbone Message Formats", + "version": "1.0", + "description": "SoAR message protocol in schemas", + }, + "specs": [ + { + "endpoint": "swagger", + "route": "/soar_protocol.json", + } + ], + "url_prefix": URL_PREFIX, + "paths": {}, + "components": { + "schemas": { + "MESSAGE": { + "type": "object", + "description": "Full message definition with" + + " message-metadata in `header` and different" + + " message type schemas under `payload`", + "properties": { + "header": { + "$ref": "#/components/schemas/header", + }, + "payload": {"$ref": "#/components/schemas/payload"}, }, - "payload": {"$ref": "#/components/schemas/payload"}, + "required": ["header", "payload"], }, - "required": ["header", "payload"], - }, - "payload": { - "discriminator": { - "propertyName": "message_type", - "mapping": { - "alert": "#/components/schemas/alert", - "mission_plan": "#/components/schemas/mission_plan", - "mission_plan_encoded": "#/components/schemas/" - + "mission_plan_encoded", - "observation": "#/components/schemas/observation", - "observation_encoded": "#/components/schemas/" - + "observation_encoded", - "planning_configuration": "#/components/schemas/" - + "planning_configuration", - "platform_status": "#/components/schemas/platform_status", - "platform_status_encoded": "#/components/schemas/" - + "platform_status_encoded", - "acknowledgement": "#/components/schemas/acknowledgement", - "survey": "#/components/schemas/survey", - "survey_encoded": "#/components/schemas/" + "survey_encoded", + "payload": { + "discriminator": { + "propertyName": "message_type", + "mapping": { + "alert": "#/components/schemas/alert", + "mission_plan": "#/components/schemas/mission_plan", + "mission_plan_encoded": "#/components/schemas/" + + "mission_plan_encoded", + "observation": "#/components/schemas/observation", + "observation_encoded": "#/components/schemas/" + + "observation_encoded", + "planning_configuration": "#/components/schemas/" + + "planning_configuration", + "platform_status": "#/components/schemas/platform_status", + "platform_status_encoded": "#/components/schemas/" + + "platform_status_encoded", + "acknowledgement": "#/components/schemas/acknowledgement", + "survey": "#/components/schemas/survey", + "survey_encoded": "#/components/schemas/" + "survey_encoded", + }, }, + "oneOf": [ + {"$ref": "#/components/schemas/alert"}, + {"$ref": "#/components/schemas/acknowledgement"}, + {"$ref": "#/components/schemas/mission_plan"}, + {"$ref": "#/components/schemas/mission_plan_encoded"}, + {"$ref": "#/components/schemas/observation"}, + {"$ref": "#/components/schemas/observation_encoded"}, + {"$ref": "#/components/schemas/planning_configuration"}, + {"$ref": "#/components/schemas/platform_status"}, + {"$ref": "#/components/schemas/platform_status_encoded"}, + {"$ref": "#/components/schemas/survey"}, + {"$ref": "#/components/schemas/survey_encoded"}, + ], }, - "oneOf": [ - {"$ref": "#/components/schemas/alert"}, - {"$ref": "#/components/schemas/acknowledgement"}, - {"$ref": "#/components/schemas/mission_plan"}, - {"$ref": "#/components/schemas/mission_plan_encoded"}, - {"$ref": "#/components/schemas/observation"}, - {"$ref": "#/components/schemas/observation_encoded"}, - {"$ref": "#/components/schemas/planning_configuration"}, - {"$ref": "#/components/schemas/platform_status"}, - {"$ref": "#/components/schemas/platform_status_encoded"}, - {"$ref": "#/components/schemas/survey"}, - {"$ref": "#/components/schemas/survey_encoded"}, - ], - }, - "header": message_header, - "mission_plan": mission_plan_schema, - "mission_plan_encoded": mission_plan_encoded_schema, - "observation": observation_schema, - "observation_encoded": observation_encoded_schema, - "planning_configuration": planning_configuration_schema, - "platform_status": platform_status_schema, - "platform_status_encoded": platform_status_encoded_schema, - "survey": survey_schema, - "survey_encoded": survey_encoded_schema, - "acknowledgement": acknowledgement_schema, - "alert": alert_schema, - } - }, -} + "header": message_header, + "mission_plan": mission_plan_schema, + "mission_plan_encoded": mission_plan_encoded_schema, + "observation": observation_schema, + "observation_encoded": observation_encoded_schema, + "planning_configuration": planning_configuration_schema, + "platform_status": platform_status_schema, + "platform_status_encoded": platform_status_encoded_schema, + "survey": survey_schema, + "survey_encoded": survey_encoded_schema, + "acknowledgement": acknowledgement_schema, + "alert": alert_schema, + } + }, + } + import_remote_refs(swagger_config) + return swagger_config def resolve_ref(ref): @@ -172,6 +176,8 @@ def inject_schema(schema, remote_ref): local_name = rename_ref(remote_ref) local_ref = f"#/components/schemas/{local_name}" ref_schema = resolve_ref(remote_ref) + del ref_schema["$id"] + del ref_schema["$schema"] if ref_schema is not None: nested_replace(schema, "$ref", remote_ref, local_ref) schema["components"]["schemas"][local_name] = ref_schema @@ -180,16 +186,19 @@ def inject_schema(schema, remote_ref): return False -def import_remote_refs(): +def import_remote_refs(swagger_config): """ inject the following remote refs into the schema and replace the remote refs with local refs returns True if all schemas resolved and injected """ + # For some reason importing Feature or FeatureCollection + # makes the schema fail to validate + ref_imports = [ - "https://geojson.org/schema/Feature.json", - "https://geojson.org/schema/FeatureCollection.json", + # "https://geojson.org/schema/Feature.json", + # "https://geojson.org/schema/FeatureCollection.json", "https://geojson.org/schema/LineString.json", "https://geojson.org/schema/MultiLineString.json", "https://geojson.org/schema/MultiPoint.json", @@ -312,7 +321,7 @@ def get_options(): if __name__ == "__main__": - import_remote_refs() + swagger_config = get_swagger_config() # Parse script args config = get_options() diff --git a/project/soar/swagger.json b/project/soar/swagger.json index bc4367dddf3e64f06feb61f2db2e90f5938b2633..e89b24f700bc0b81654c049757f83f00d49f24da 100644 --- a/project/soar/swagger.json +++ b/project/soar/swagger.json @@ -111,1045 +111,7 @@ ], "type": "object" }, - "geojson.org.schema.Feature.json": { - "$id": "https://geojson.org/schema/Feature.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "geometry": { - "oneOf": [ - { - "type": "null" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "Point" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Point", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "LineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON LineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "Polygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Polygon", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPoint" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPoint", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiLineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiLineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPolygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPolygon", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "geometries": { - "items": { - "oneOf": [ - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "Point" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Point", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "LineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON LineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "Polygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Polygon", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPoint" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPoint", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiLineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiLineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPolygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPolygon", - "type": "object" - } - ] - }, - "type": "array" - }, - "type": { - "enum": [ - "GeometryCollection" - ], - "type": "string" - } - }, - "required": [ - "type", - "geometries" - ], - "title": "GeoJSON GeometryCollection", - "type": "object" - } - ] - }, - "id": { - "oneOf": [ - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - "properties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "object" - } - ] - }, - "type": { - "enum": [ - "Feature" - ], - "type": "string" - } - }, - "required": [ - "type", - "properties", - "geometry" - ], - "title": "GeoJSON Feature", - "type": "object" - }, - "geojson.org.schema.FeatureCollection.json": { - "$id": "https://geojson.org/schema/FeatureCollection.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "features": { - "items": { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "geometry": { - "oneOf": [ - { - "type": "null" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "Point" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Point", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "LineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON LineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "Polygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Polygon", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPoint" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPoint", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiLineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiLineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPolygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPolygon", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "geometries": { - "items": { - "oneOf": [ - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "Point" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Point", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": { - "enum": [ - "LineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON LineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "Polygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON Polygon", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPoint" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPoint", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 2, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiLineString" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiLineString", - "type": "object" - }, - { - "properties": { - "bbox": { - "items": { - "type": "number" - }, - "minItems": 4, - "type": "array" - }, - "coordinates": { - "items": { - "items": { - "items": { - "items": { - "type": "number" - }, - "minItems": 2, - "type": "array" - }, - "minItems": 4, - "type": "array" - }, - "type": "array" - }, - "type": "array" - }, - "type": { - "enum": [ - "MultiPolygon" - ], - "type": "string" - } - }, - "required": [ - "type", - "coordinates" - ], - "title": "GeoJSON MultiPolygon", - "type": "object" - } - ] - }, - "type": "array" - }, - "type": { - "enum": [ - "GeometryCollection" - ], - "type": "string" - } - }, - "required": [ - "type", - "geometries" - ], - "title": "GeoJSON GeometryCollection", - "type": "object" - } - ] - }, - "id": { - "oneOf": [ - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - "properties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "object" - } - ] - }, - "type": { - "enum": [ - "Feature" - ], - "type": "string" - } - }, - "required": [ - "type", - "properties", - "geometry" - ], - "title": "GeoJSON Feature", - "type": "object" - }, - "type": "array" - }, - "type": { - "enum": [ - "FeatureCollection" - ], - "type": "string" - } - }, - "required": [ - "type", - "features" - ], - "title": "GeoJSON FeatureCollection", - "type": "object" - }, "geojson.org.schema.LineString.json": { - "$id": "https://geojson.org/schema/LineString.json", - "$schema": "http://json-schema.org/draft-07/schema#", "properties": { "bbox": { "items": { @@ -1184,8 +146,6 @@ "type": "object" }, "geojson.org.schema.MultiLineString.json": { - "$id": "https://geojson.org/schema/MultiLineString.json", - "$schema": "http://json-schema.org/draft-07/schema#", "properties": { "bbox": { "items": { @@ -1223,8 +183,6 @@ "type": "object" }, "geojson.org.schema.MultiPoint.json": { - "$id": "https://geojson.org/schema/MultiPoint.json", - "$schema": "http://json-schema.org/draft-07/schema#", "properties": { "bbox": { "items": { @@ -1258,8 +216,6 @@ "type": "object" }, "geojson.org.schema.MultiPolygon.json": { - "$id": "https://geojson.org/schema/MultiPolygon.json", - "$schema": "http://json-schema.org/draft-07/schema#", "properties": { "bbox": { "items": { @@ -1300,8 +256,6 @@ "type": "object" }, "geojson.org.schema.Point.json": { - "$id": "https://geojson.org/schema/Point.json", - "$schema": "http://json-schema.org/draft-07/schema#", "properties": { "bbox": { "items": { @@ -1332,8 +286,6 @@ "type": "object" }, "geojson.org.schema.Polygon.json": { - "$id": "https://geojson.org/schema/Polygon.json", - "$schema": "http://json-schema.org/draft-07/schema#", "properties": { "bbox": { "items": { @@ -1814,7 +766,8 @@ } }, "required": [ - "target_waypoint" + "target_waypoint_latitude", + "target_waypoint_longitude" ], "type": "object" }, diff --git a/tests/test_schemas.py b/tests/test_schemas.py index 421c48ba6e27e0bfd3260f7c0ae2f359d735111c..9b8e1aa624e07d0e1d7524d43e85d3bc16812a4d 100644 --- a/tests/test_schemas.py +++ b/tests/test_schemas.py @@ -5,7 +5,7 @@ from jsonschema.validators import RefResolver import unittest import json import os -from generate_schema_config import write_schema, swagger_config +from generate_schema_config import write_schema, get_swagger_config MOCK_DATA_DIR = "examples/" @@ -24,6 +24,7 @@ class SchemaTestCase(unittest.TestCase): def setUpClass(cls): test_schema_path = "tests/test_swagger.json" os.environ["SCHEMA_PATH"] = test_schema_path + swagger_config = get_swagger_config() write_schema(swagger_config, test_schema_path)