{ "openapi": "3.1.0", "info": { "title": "Weather in metric units", "description": "Weather information for a given location, either current weather prediction or historical weather observations, using metric units.", "version": "0.1.4" }, "paths": { "/Meteorology/Weather_v0.1": { "post": { "tags": ["Environment"], "summary": "Weather in metric units", "description": "Weather information for a given location, either current weather prediction or historical weather observations, using metric units.", "operationId": "request_Meteorology_Weather_v0_1", "parameters": [ { "name": "x-api-key", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-API-Key", "description": "API key or token" }, "description": "API key or token" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WeatherRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WeatherResponse" } } } }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" } } }, "description": "Bad Request" }, "401": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Forbidden" } } }, "description": "Forbidden" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } } }, "description": "Not Found" }, "429": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RateLimitExceeded" } } }, "description": "Too Many Requests" }, "444": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DataSourceNotFound" } } }, "description": "Additional Response" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DataSourceError" } } }, "description": "Internal Server Error" }, "502": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadGateway" } } }, "description": "Bad Gateway" }, "503": { "content": { "text/plain": {}, "text/html": {}, "application/json": { "schema": { "$ref": "#/components/schemas/ServiceUnavailable" } } }, "description": "Service Unavailable" }, "504": { "content": { "text/plain": {}, "text/html": {}, "application/json": { "schema": { "$ref": "#/components/schemas/GatewayTimeout" } } }, "description": "Gateway Timeout" }, "550": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DoesNotConformToDefinition" } } }, "description": "Additional Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "BadGateway": { "properties": { "type": { "type": "string", "const": "bad_gateway", "title": "Error type", "description": "An identifier for the type of error." }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Bad Gateway"] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "BadGateway", "description": "This response is reserved by Product Gateway." }, "BadRequest": { "properties": { "type": { "type": "string", "pattern": "^[a-z0-9_]*$", "title": "Error type", "description": "An identifier for the type of error.", "examples": ["validation_error"] }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Validation failed for fieldName: error description."] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "BadRequest" }, "DataSourceError": { "properties": { "type": { "type": "string", "pattern": "^[a-z0-9_]*$", "title": "Error type", "description": "An identifier for the type of error.", "examples": ["upstream_error"] }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": [ "Failed to connect to the upstream service, please try again later." ] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "DataSourceError" }, "DataSourceNotFound": { "properties": { "type": { "type": "string", "const": "data_source_not_found", "title": "Error type", "description": "An identifier for the type of error." }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Data source not found"] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "DataSourceNotFound", "description": "This response is reserved by Product Gateway." }, "DoesNotConformToDefinition": { "properties": { "type": { "type": "string", "const": "does_not_conform_to_definition", "title": "Error type", "description": "An identifier for the type of error." }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Response from data source does not conform to definition"] }, "data_source_status_code": { "type": "integer", "title": "Data source status code", "description": "HTTP status code returned from the data source", "examples": [200] } }, "additionalProperties": false, "type": "object", "required": ["type", "message", "data_source_status_code"], "title": "DoesNotConformToDefinition", "description": "This response is reserved by Product Gateway." }, "Forbidden": { "properties": { "type": { "type": "string", "pattern": "^[a-z0-9_]*$", "title": "Error type", "description": "An identifier for the type of error.", "examples": ["forbidden"] }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["No access to requested data for group 'example'."] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "Forbidden" }, "GatewayTimeout": { "properties": { "type": { "type": "string", "const": "gateway_timeout", "title": "Error type", "description": "An identifier for the type of error." }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Gateway Timeout"] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "GatewayTimeout", "description": "This response is reserved by Product Gateway." }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "NotFound": { "properties": { "type": { "type": "string", "pattern": "^[a-z0-9_]*$", "title": "Error type", "description": "An identifier for the type of error.", "examples": ["not_found"] }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Not found"] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "NotFound" }, "RateLimitExceeded": { "properties": { "type": { "type": "string", "pattern": "^[a-z0-9_]*$", "title": "Error type", "description": "An identifier for the type of error.", "examples": ["rate_limit_exceeded"] }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Rate limit exceeded"] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "RateLimitExceeded", "description": "This response is reserved by Product Gateway." }, "ServiceUnavailable": { "properties": { "type": { "type": "string", "const": "service_unavailable", "title": "Error type", "description": "An identifier for the type of error." }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["Service Unavailable"] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "ServiceUnavailable", "description": "This response is reserved by Product Gateway." }, "Unauthorized": { "properties": { "type": { "type": "string", "pattern": "^[a-z0-9_]*$", "title": "Error type", "description": "An identifier for the type of error.", "examples": ["api_token_missing_or_invalid"] }, "message": { "type": "string", "title": "Error message", "description": "A human readable description of the error.", "examples": ["The API token has expired"] } }, "additionalProperties": false, "type": "object", "required": ["type", "message"], "title": "Unauthorized" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError" }, "WeatherRequest": { "properties": { "lat": { "type": "number", "maximum": 90.0, "minimum": -90.0, "title": "Latitude (°)", "description": "The latitude coordinate of the desired location in degrees.", "examples": [60.192] }, "lon": { "type": "number", "maximum": 180.0, "minimum": -180.0, "title": "Longitude (°)", "description": "The longitude coordinate of the desired location in degrees.", "examples": [24.945] }, "when": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Date and time", "description": "Date and time in RFC 3339 format. If not specified, returns the current weather.", "examples": ["2023-04-12T23:20:50Z"] } }, "type": "object", "required": ["lat", "lon"], "title": "Weather request" }, "WeatherResponse": { "properties": { "temperature": { "type": "number", "minimum": -273.15, "title": "Temperature (°C)", "description": "Current temperature in degrees Celsius.", "examples": [17.3] }, "humidity": { "anyOf": [ { "type": "number", "maximum": 100.0, "minimum": 0.0 }, { "type": "null" } ], "title": "Humidity (%)", "description": "Current relative air humidity percentage.", "examples": [72.0] }, "pressure": { "anyOf": [ { "type": "number", "minimum": 0.0 }, { "type": "null" } ], "title": "Pressure (hPa)", "description": "Current air pressure in hectopascals.", "examples": [1007.0] }, "windSpeed": { "anyOf": [ { "type": "number", "minimum": 0.0 }, { "type": "null" } ], "title": "Wind speed (m/s)", "description": "Current wind speed in meters per second.", "examples": [2.1] }, "windDirection": { "anyOf": [ { "type": "number", "maximum": 360.0, "minimum": 0.0 }, { "type": "null" } ], "title": "Wind direction (°)", "description": "Current wind direction in meteorological wind direction degrees.", "examples": [220.0] }, "precipitation": { "anyOf": [ { "type": "number", "maximum": 1000.0, "minimum": 0.0 }, { "type": "null" } ], "title": "Precipitation (mm/h)", "description": "Current precipitation in millimeters per hour.", "examples": [120.0] }, "visibility": { "anyOf": [ { "type": "number", "maximum": 300000.0, "minimum": 0.0 }, { "type": "null" } ], "title": "Visibility (m)", "description": "Visibility in meters.", "examples": [320.0] } }, "type": "object", "required": ["temperature"], "title": "Weather response" } } }, "x-strict-validation": false }