diff --git a/flexmeasures/api/v3_0/deprecated.py b/flexmeasures/api/v3_0/deprecated.py index 0974abac21..936addb706 100644 --- a/flexmeasures/api/v3_0/deprecated.py +++ b/flexmeasures/api/v3_0/deprecated.py @@ -3,6 +3,14 @@ from flask_security import auth_required, current_user from webargs.flaskparser import use_args + +def _deprecation_headers(): + return { + "Deprecation": "true", + "Sunset": "Sat, 01 Jan 2025 00:00:00 GMT", + "Link": '; rel="successor-version"', + } + from flexmeasures.api.common.schemas.sensor_data import ( GetSensorDataSchema, GetSensorDataSchemaEntityAddress, @@ -53,7 +61,7 @@ def get_data_deprecated(self, sensor_data_description: dict): sensor_data_description ) d, s = request_processed() - return dict(**response, **d), s + return dict(**response, **d), s, _deprecation_headers() @route("/data", methods=["POST"]) @use_args( @@ -81,4 +89,4 @@ def post_data_deprecated(self, data: dict): f"User {current_user} called the deprecated endpoint /sensors/data for sensor {sensor_id}. Should start using /sensors/{sensor_id}/data." ) response, code = save_and_enqueue(bdf) - return response, code + return response, code, _deprecation_headers()