fix(api): bind version and health endpoints to app.__version__

This commit is contained in:
2026-10-07 18:05:52 -03:00
parent a60a7cdc78
commit 5764203232
+4 -2
View File
@@ -241,12 +241,14 @@ def get_openapi_spec():
"""Serves the OpenAPI 3.0 specification for Schemathesis / DAST and Swagger UI.""" """Serves the OpenAPI 3.0 specification for Schemathesis / DAST and Swagger UI."""
return jsonify(OPENAPI_SPEC) return jsonify(OPENAPI_SPEC)
from app import __version__
@api_openapi_bp.route('/version', methods=['GET']) @api_openapi_bp.route('/version', methods=['GET'])
def get_api_version(): def get_api_version():
"""Returns the backend API version information.""" """Returns the backend API version information."""
return jsonify({ return jsonify({
"name": "Edu-Space REST API", "name": "Edu-Space REST API",
"version": "3.3.0", "version": __version__,
"status": "healthy" "status": "healthy"
}), 200 }), 200
@@ -255,5 +257,5 @@ def get_api_health():
"""Liveness probe for backend API.""" """Liveness probe for backend API."""
return jsonify({ return jsonify({
"status": "ok", "status": "ok",
"version": "3.3.0" "version": __version__
}), 200 }), 200