refs #1084 Adds swagger documentation to all endpoints of ogrepository

ogrepository_installer
Luis Gerardo Romero Garcia 2024-10-29 13:15:32 +01:00
parent 62e67b7437
commit 43846b0382
2 changed files with 1515 additions and 4 deletions

View File

@ -20,8 +20,8 @@ import os
import subprocess
import json
from time import sleep
from flasgger import Swagger
import yaml
# --------------------------------------------------------------------------------------------
# VARIABLES
# --------------------------------------------------------------------------------------------
@ -32,7 +32,6 @@ repo_file = '/opt/opengnsys/etc/repoinfo.json'
trash_file = '/opt/opengnsys/etc/trashinfo.json'
# --------------------------------------------------------------------------------------------
# FUNCTIONS
# --------------------------------------------------------------------------------------------
@ -41,7 +40,9 @@ trash_file = '/opt/opengnsys/etc/trashinfo.json'
# Creamos una instancia de la aplicación Flask:
app = Flask(__name__)
with open("swagger.yaml", "r") as file:
swagger_template = yaml.safe_load(file)
swagger = Swagger(app, template=swagger_template)
# ---------------------------------------------------------

1510
api/swagger.yaml 100644

File diff suppressed because it is too large Load Diff