From 9d644605d5023f47ed5450bc78c60dbde01f6c81 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi <256895@studenti.unimore.it> Date: Thu, 6 May 2021 02:57:26 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Reformat=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/backend/nest_backend/api_schemas.py | 2 +- code/backend/nest_backend/api_spec.py | 2 +- code/backend/nest_backend/swagger.py | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/backend/nest_backend/api_schemas.py b/code/backend/nest_backend/api_schemas.py index ddf3cf5..440c4f3 100644 --- a/code/backend/nest_backend/api_schemas.py +++ b/code/backend/nest_backend/api_schemas.py @@ -54,4 +54,4 @@ class RepositorySchema(Schema): class RepositoryUpdate(Schema): name = fields.String(description="If present, it changes the name of the repository.") close = fields.String(description="If present, it closes the repository.") - open = fields.String(description="If present, it opens the repository.") \ No newline at end of file + open = fields.String(description="If present, it opens the repository.") diff --git a/code/backend/nest_backend/api_spec.py b/code/backend/nest_backend/api_spec.py index 1fa46ee..3a883b4 100644 --- a/code/backend/nest_backend/api_spec.py +++ b/code/backend/nest_backend/api_spec.py @@ -25,7 +25,7 @@ spec.components.schema("CreateUser", schema=CreateUser) spec.components.schema("Repository", schema=RepositorySchema) spec.components.schema("IntegerParameter", schema=IntegerParameterSchema) spec.components.schema("RepositoryUpdate", schema=RepositoryUpdate) -spec.components.security_scheme("jwt", {"type":"http", "scheme":"bearer", "bearerFormat":"JWT"}) +spec.components.security_scheme("jwt", {"type": "http", "scheme": "bearer", "bearerFormat": "JWT"}) # add swagger tags that are used for endpoint annotation tags = [ diff --git a/code/backend/nest_backend/swagger.py b/code/backend/nest_backend/swagger.py index 19e71c1..15aab56 100644 --- a/code/backend/nest_backend/swagger.py +++ b/code/backend/nest_backend/swagger.py @@ -2,8 +2,9 @@ from flask_swagger_ui import get_swaggerui_blueprint -SWAGGER_URL = '/api/v1/docs' -API_URL = "/api/v1/swagger.json" +SWAGGER_URL = '/docs/' +# FIXME: this will break if the website root isn't /, use url_for() instead! +API_URL = "/docs/swagger.json" # Call factory function to create our blueprint swagger_ui_blueprint = get_swaggerui_blueprint( @@ -12,4 +13,4 @@ swagger_ui_blueprint = get_swaggerui_blueprint( config={ 'app_name': "N.E.S.T." } -) \ No newline at end of file +)