From ec6ba6544fa85c508cb754ad3f0c6bcbe953add6 Mon Sep 17 00:00:00 2001 From: "code.europa.eu Bot" <bot@code.europa.eu> Date: Fri, 1 Mar 2024 13:57:53 +0000 Subject: [PATCH] fix styling --- api/src/flask_best_practices_api/wsgi.py | 1 + public/0.0.1.openapi.json | 1 + public/0.0.2.openapi.json | 1 + public/0.0.3.openapi.json | 1 + public/index.html | 12 ++++++++++++ public/versions.js | 1 + 6 files changed, 17 insertions(+) create mode 100644 public/0.0.1.openapi.json create mode 100644 public/0.0.2.openapi.json create mode 100644 public/0.0.3.openapi.json create mode 100644 public/index.html create mode 100644 public/versions.js diff --git a/api/src/flask_best_practices_api/wsgi.py b/api/src/flask_best_practices_api/wsgi.py index e74988f..e261038 100644 --- a/api/src/flask_best_practices_api/wsgi.py +++ b/api/src/flask_best_practices_api/wsgi.py @@ -12,6 +12,7 @@ logging.info("This message matches the standard formatting") api.register_blueprint(root_bp, url_prefix='/') + def get_openapi(): with api.app_context(): with api.test_client() as client: diff --git a/public/0.0.1.openapi.json b/public/0.0.1.openapi.json new file mode 100644 index 0000000..eb4507f --- /dev/null +++ b/public/0.0.1.openapi.json @@ -0,0 +1 @@ +{"definitions":{"Color":{"type":"string"},"Palette":{"properties":{"palette_name":{"items":{"$ref":"#/definitions/Color"},"type":"array"}},"type":"object"}},"info":{"description":"powered by Flasgger","termsOfService":"/tos","title":"A swagger API","version":"0.0.1"},"paths":{"/":{"get":{"description":"This is using docstrings for specifications.<br/>","parameters":[{"default":"all","enum":["all","rgb","cmyk"],"in":"path","name":"palette","required":true,"type":"string"}],"responses":{"200":{"description":"A list of colors (may be filtered by palette)","examples":{"rgb":["red","green","blue"]},"schema":{"$ref":"#/definitions/Palette"}}},"summary":"Example endpoint returning a list of colors by palette"}}},"swagger":"2.0"} diff --git a/public/0.0.2.openapi.json b/public/0.0.2.openapi.json new file mode 100644 index 0000000..eb4507f --- /dev/null +++ b/public/0.0.2.openapi.json @@ -0,0 +1 @@ +{"definitions":{"Color":{"type":"string"},"Palette":{"properties":{"palette_name":{"items":{"$ref":"#/definitions/Color"},"type":"array"}},"type":"object"}},"info":{"description":"powered by Flasgger","termsOfService":"/tos","title":"A swagger API","version":"0.0.1"},"paths":{"/":{"get":{"description":"This is using docstrings for specifications.<br/>","parameters":[{"default":"all","enum":["all","rgb","cmyk"],"in":"path","name":"palette","required":true,"type":"string"}],"responses":{"200":{"description":"A list of colors (may be filtered by palette)","examples":{"rgb":["red","green","blue"]},"schema":{"$ref":"#/definitions/Palette"}}},"summary":"Example endpoint returning a list of colors by palette"}}},"swagger":"2.0"} diff --git a/public/0.0.3.openapi.json b/public/0.0.3.openapi.json new file mode 100644 index 0000000..02d806b --- /dev/null +++ b/public/0.0.3.openapi.json @@ -0,0 +1 @@ +{"definitions":{},"info":{"description":"powered by Flasgger","termsOfService":"/tos","title":"A swagger API","version":"0.0.1"},"paths":{},"swagger":"2.0"} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..39e8ff9 --- /dev/null +++ b/public/index.html @@ -0,0 +1,12 @@ +<html> + +<head> + <script src="versions.js"></script> + <script>console.log(NMS_OPENAPI_VERSIONS)</script> +</head> + +<body> + Blabetiblou +</body> + +</html> \ No newline at end of file diff --git a/public/versions.js b/public/versions.js new file mode 100644 index 0000000..46fe280 --- /dev/null +++ b/public/versions.js @@ -0,0 +1 @@ +NMS_OPENAPI_VERSIONS = {"0.0.1": "public/0.0.1.openapi.json", "0.0.2": "public/0.0.2.openapi.json", "0.0.3": "public/0.0.3.openapi.json"} \ No newline at end of file -- GitLab