diff --git a/docs/openapi.json b/docs/openapi.json index 3c5a91f0..3a21dbf9 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -1,11 +1,9 @@ { - "definitions": {}, "info": { "description": "Submit workflows to be run on REANA Cloud", "title": "REANA Server", "version": "0.9.1a3" }, - "parameters": {}, "paths": { "/account/settings/linkedaccounts/": {}, "/account/settings/linkedaccounts/static/{filename}": {}, @@ -4450,6 +4448,5 @@ "/signin": {}, "/signup/": {} }, - "swagger": "2.0", - "tags": [] + "swagger": "2.0" } diff --git a/reana_server/rest/info.py b/reana_server/rest/info.py index 8a45057f..0b12dae4 100644 --- a/reana_server/rest/info.py +++ b/reana_server/rest/info.py @@ -53,7 +53,79 @@ def info(user, **kwargs): # noqa 200: description: >- Request succeeded. The response contains general info about the cluster. - schema: InfoSchema + schema: + properties: + compute_backends: + properties: + title: + type: string + value: + items: + type: string + type: array + type: object + default_kubernetes_jobs_timeout: + properties: + title: + type: string + value: + type: string + type: object + default_kubernetes_memory_limit: + properties: + title: + type: string + value: + type: string + type: object + default_workspace: + properties: + title: + type: string + value: + type: string + type: object + kubernetes_max_memory_limit: + properties: + title: + type: string + value: + type: string + x-nullable: true + type: object + maximum_interactive_session_inactivity_period: + properties: + title: + type: string + value: + type: string + x-nullable: true + type: object + maximum_kubernetes_jobs_timeout: + properties: + title: + type: string + value: + type: string + type: object + maximum_workspace_retention_period: + properties: + title: + type: string + value: + type: string + x-nullable: true + type: object + workspaces_available: + properties: + title: + type: string + value: + items: + type: string + type: array + type: object + type: object examples: application/json: { diff --git a/scripts/generate_openapi_spec.py b/scripts/generate_openapi_spec.py index 5b02c8f5..0d6c49ca 100644 --- a/scripts/generate_openapi_spec.py +++ b/scripts/generate_openapi_spec.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # This file is part of REANA. -# Copyright (C) 2017, 2018, 2020, 2021, 2022 CERN. +# Copyright (C) 2017, 2018, 2020, 2021, 2022, 2023 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -14,6 +14,7 @@ import click from apispec import APISpec +from apispec_webframeworks.flask import FlaskPlugin from flask import current_app from flask.cli import with_appcontext from reana_commons.utils import copy_openapi_specs @@ -57,8 +58,9 @@ def build_openapi_spec(publish): spec = APISpec( title=package, version=ver, + openapi_version="2.0", info=dict(description=desc), - plugins=("apispec.ext.flask", "apispec.ext.marshmallow"), + plugins=(FlaskPlugin(),), ) # Add marshmallow schemas to the specification here @@ -67,7 +69,7 @@ def build_openapi_spec(publish): # Collect OpenAPI docstrings from Flask endpoints for key in current_app.view_functions: if key != "static" and key != "get_openapi_spec": - spec.add_path(view=current_app.view_functions[key]) + spec.path(view=current_app.view_functions[key]) spec_json = json.dumps( spec.to_dict(), indent=2, separators=(",", ": "), sort_keys=True