""" schema: Observation Message sent by platforms when points of interest are found. """ # from . import full_message_schema, api # from flask_restx import fields hits_schema = { "type": "object", "properties": { "latitude": { "type": "number", "description": "Identified x-coordinate of point of interest", "example": 178.2, }, "longitude": { "type": "number", "description": "Identified y-coordinate of point of interest", "example": -10.122, }, "quality_of_point": { "type": "number", "description": "Quality/strength of points from features of" + " interest identified by platform. TODO: DEFINE FORMAT.", "example": 0.98, }, }, "required": [], } observation_schema = { "allOf": [{"$ref": "#/components/schemas/Message"}], "type": "object", "properties": { "platform_ID": { "type": "integer", "description": "ID of platform to sending observations", "example": "ecosub-3", }, # "observation_type" ==> payloads tied to different types maybe? # properties of each observation? "points_of_interest": { "type": "array", "items": hits_schema, "description": "Points from features of interest identified by" + " platform if any found. DEFINE FORMAT.", }, "region_surveyed": { "description": "Region surveyed by given platform. DEFINE FORMAT." + " GEOJSON", "example": "", }, "additional_data": { "description": "Placeholder field for any additional data", "example": {"sensor_payload": False}, }, }, "required": ["platform_serial"], } # observation_schema = api.model( # "Observation", # { # "message": fields.Nested( # full_message_schema, # required=True, # description="Message header", # ), # "platform_serial": fields.String( # required=True, # description="Serial of platform to sendign observations", # example="ecosub-3", # ), # # "observation_type" ==> payloads tied to different types maybe? # # properties of each observation? # "points_of_interest": fields.Float( # required=False, # description="Points from features of interest identified by" # + " platform if any found. DEFINE FORMAT.", # example="", # ), # "region_surveyed": fields.Float( # required=False, # description="Region surveyed by given platform. DEFINE FORMAT." # + " GEOJSON?", # example="", # ), # "quality_of_points": fields.Float( # required=False, # description="Quality/strength of points from features of" # + " interest identified by platform. DEFINE FORMAT.", # example=0.98, # ), # "additional_data": fields.Raw( # required=False, # description="Placeholder field for any additional data", # example={"sensor_payload": False}, # ), # }, # )