diff --git a/api/specs/common/schemas/node-meta-v0.0.1-pydantic-converted-clean.yaml b/api/specs/common/schemas/node-meta-v0.0.1-pydantic-converted-clean.yaml index d5d53587ca6..d53192b9325 100644 --- a/api/specs/common/schemas/node-meta-v0.0.1-pydantic-converted-clean.yaml +++ b/api/specs/common/schemas/node-meta-v0.0.1-pydantic-converted-clean.yaml @@ -390,7 +390,6 @@ properties: type: string key: description: distinctive name for the node based on the docker registry path - example: simcore/services/comp/itis/sleeper pattern: ^(simcore)/(services)/(comp|dynamic|frontend)(/[\w/-]+)+$ title: Key type: string @@ -571,7 +570,6 @@ properties: example: computational version: description: service version number - example: 1.0.0 pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ title: Version type: string diff --git a/api/specs/common/schemas/node-meta-v0.0.1-pydantic.json b/api/specs/common/schemas/node-meta-v0.0.1-pydantic.json index 6a5c0c7e6c7..67043286e1a 100644 --- a/api/specs/common/schemas/node-meta-v0.0.1-pydantic.json +++ b/api/specs/common/schemas/node-meta-v0.0.1-pydantic.json @@ -33,20 +33,12 @@ "title": "Key", "description": "distinctive name for the node based on the docker registry path", "pattern": "^(simcore)/(services)/(comp|dynamic|frontend)(/[\\w/-]+)+$", - "examples": [ - "simcore/services/comp/itis/sleeper", - "simcore/services/dynamic/3dviewer" - ], "type": "string" }, "version": { "title": "Version", "description": "service version number", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", - "examples": [ - "1.0.0", - "0.0.1" - ], "type": "string" }, "integration-version": { @@ -840,7 +832,7 @@ "type": "computational", "integration-version": "1.0.0", "version": "1.7.0", - "description": "oSparc Python Runner", + "description": "oSparc Python Runner with boot options", "contact": "smith@company.com", "authors": [ { @@ -1820,4 +1812,4 @@ ] } } -} \ No newline at end of file +} diff --git a/api/specs/common/schemas/project-v0.0.1-pydantic-converted-clean.yaml b/api/specs/common/schemas/project-v0.0.1-pydantic-converted-clean.yaml index 527c8a3484f..2bc94691e44 100644 --- a/api/specs/common/schemas/project-v0.0.1-pydantic-converted-clean.yaml +++ b/api/specs/common/schemas/project-v0.0.1-pydantic-converted-clean.yaml @@ -67,7 +67,6 @@ properties: title: Prjowner type: string quality: - default: {} description: stores the study quality assessment title: Quality type: object @@ -479,6 +478,7 @@ properties: title: Downloadlink type: string label: + description: Display name title: Label type: string required: @@ -642,6 +642,7 @@ properties: title: Downloadlink type: string label: + description: Display name title: Label type: string required: diff --git a/api/specs/common/schemas/project-v0.0.1-pydantic.json b/api/specs/common/schemas/project-v0.0.1-pydantic.json index 91a645e4a7a..59102d49a22 100644 --- a/api/specs/common/schemas/project-v0.0.1-pydantic.json +++ b/api/specs/common/schemas/project-v0.0.1-pydantic.json @@ -321,6 +321,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -546,6 +547,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1093,7 +1095,6 @@ "quality": { "title": "Quality", "description": "stores the study quality assessment", - "default": {}, "type": "object" }, "dev": { @@ -1288,6 +1289,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1677,6 +1679,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1902,6 +1905,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, diff --git a/api/specs/common/schemas/scripts/remove_definitions.py b/api/specs/common/schemas/scripts/remove_definitions.py index 993995c2ce8..20beda83ff9 100644 --- a/api/specs/common/schemas/scripts/remove_definitions.py +++ b/api/specs/common/schemas/scripts/remove_definitions.py @@ -1,17 +1,38 @@ -import os +import argparse +import logging import sys +from pathlib import Path + import yaml -DIR_PATH = os.path.dirname(os.path.realpath(__file__)) -source_file_name = sys.argv[1] -target_file_name = sys.argv[2] -file_source_path = DIR_PATH + f"/../{source_file_name}" -file_target_path = DIR_PATH + f"/../{target_file_name}" +log = logging.getLogger(__name__) + + +current_dir = Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent +schemas_dir = current_dir.parent + + +if __name__ == "__main__": + + parser = argparse.ArgumentParser( + "Remove Definitions", + description="prunes 'definitions' from json-schemas in 'source_file_name' and dumps it into 'target_file_name'", + ) + parser.add_argument("source_file_name", type=str) + parser.add_argument("target_file_name", type=str) + args = parser.parse_args() + + file_source_path: Path = schemas_dir / args.source_file_name + file_target_path: Path = schemas_dir / args.target_file_name -with open(file_source_path, "r") as stream: try: - data = yaml.safe_load(stream) + data = yaml.safe_load(file_source_path.read_text()) data.pop("definitions", None) - yaml.dump(data, open(file_target_path, "w")) + with open(file_target_path, "w") as file_stream: + yaml.safe_dump(data, file_stream) except yaml.YAMLError as exc: - print(exc) + log.error( + "Ignoring error while load+pop+dump %s -> %s", + file_source_path, + file_target_path, + ) diff --git a/services/storage/src/simcore_service_storage/api/Makefile b/services/storage/src/simcore_service_storage/api/Makefile index da09e56c555..8a25e525499 100644 --- a/services/storage/src/simcore_service_storage/api/Makefile +++ b/services/storage/src/simcore_service_storage/api/Makefile @@ -11,7 +11,7 @@ API_SPECS_DIR = $(abspath $(CURDIR)../../../../../../api/specs) API_PARTS_DIR = ${API_SPECS_DIR}/${APP_NAME} OAS_SOURCES = $(shell find ${API_PARTS_DIR} -type f -name '*.y*ml') -API_COMMON_JSON_SCHEMAS = $(shell find ${API_SPECS_DIR}/common/schemas -type f -name '*.json') +API_COMMON_JSON_SCHEMAS = $(shell find ${API_SPECS_DIR}/common/schemas -type f -name '*pydantic.json') .PHONY: .update-schemas diff --git a/services/storage/src/simcore_service_storage/api/v0/openapi.yaml b/services/storage/src/simcore_service_storage/api/v0/openapi.yaml index 6eb6bec08af..f2f02538e22 100644 --- a/services/storage/src/simcore_service_storage/api/v0/openapi.yaml +++ b/services/storage/src/simcore_service_storage/api/v0/openapi.yaml @@ -1226,7 +1226,6 @@ components: title: Prjowner type: string quality: - default: {} description: stores the study quality assessment title: Quality type: object @@ -1627,6 +1626,7 @@ components: title: Downloadlink type: string label: + description: Display name title: Label type: string required: @@ -1781,6 +1781,7 @@ components: title: Downloadlink type: string label: + description: Display name title: Label type: string required: diff --git a/services/storage/src/simcore_service_storage/api/v0/schemas/node-meta-v0.0.1-pydantic.json b/services/storage/src/simcore_service_storage/api/v0/schemas/node-meta-v0.0.1-pydantic.json index 2efda637384..67043286e1a 100644 --- a/services/storage/src/simcore_service_storage/api/v0/schemas/node-meta-v0.0.1-pydantic.json +++ b/services/storage/src/simcore_service_storage/api/v0/schemas/node-meta-v0.0.1-pydantic.json @@ -33,20 +33,12 @@ "title": "Key", "description": "distinctive name for the node based on the docker registry path", "pattern": "^(simcore)/(services)/(comp|dynamic|frontend)(/[\\w/-]+)+$", - "examples": [ - "simcore/services/comp/itis/sleeper", - "simcore/services/dynamic/3dviewer" - ], "type": "string" }, "version": { "title": "Version", "description": "service version number", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", - "examples": [ - "1.0.0", - "0.0.1" - ], "type": "string" }, "integration-version": { @@ -840,7 +832,7 @@ "type": "computational", "integration-version": "1.0.0", "version": "1.7.0", - "description": "oSparc Python Runner", + "description": "oSparc Python Runner with boot options", "contact": "smith@company.com", "authors": [ { diff --git a/services/storage/src/simcore_service_storage/api/v0/schemas/project-v0.0.1-pydantic.json b/services/storage/src/simcore_service_storage/api/v0/schemas/project-v0.0.1-pydantic.json index 91a645e4a7a..59102d49a22 100644 --- a/services/storage/src/simcore_service_storage/api/v0/schemas/project-v0.0.1-pydantic.json +++ b/services/storage/src/simcore_service_storage/api/v0/schemas/project-v0.0.1-pydantic.json @@ -321,6 +321,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -546,6 +547,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1093,7 +1095,6 @@ "quality": { "title": "Quality", "description": "stores the study quality assessment", - "default": {}, "type": "object" }, "dev": { @@ -1288,6 +1289,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1677,6 +1679,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1902,6 +1905,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, diff --git a/services/web/server/src/simcore_service_webserver/api/Makefile b/services/web/server/src/simcore_service_webserver/api/Makefile index b54ac91d4f3..4cc26acea3d 100644 --- a/services/web/server/src/simcore_service_webserver/api/Makefile +++ b/services/web/server/src/simcore_service_webserver/api/Makefile @@ -11,7 +11,7 @@ API_SPECS_DIR = $(abspath $(CURDIR)../../../../../../../api/specs) API_PARTS_DIR = ${API_SPECS_DIR}/${APP_NAME} OAS_SOURCES = $(shell find ${API_PARTS_DIR} -type f -name '*.y*ml') -API_COMMON_JSON_SCHEMAS = $(shell find ${API_SPECS_DIR}/common/schemas -type f -name '*.json') +API_COMMON_JSON_SCHEMAS = $(shell find ${API_SPECS_DIR}/common/schemas -type f -name '*pydantic.json') .PHONY: .update-schemas diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index a23d52bb0cd..bc54527f520 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -2487,7 +2487,6 @@ paths: title: Prjowner type: string quality: - default: {} description: stores the study quality assessment title: Quality type: object @@ -2888,6 +2887,7 @@ paths: title: Downloadlink type: string label: + description: Display name title: Label type: string required: @@ -3042,6 +3042,7 @@ paths: title: Downloadlink type: string label: + description: Display name title: Label type: string required: diff --git a/services/web/server/src/simcore_service_webserver/api/v0/schemas/node-meta-v0.0.1-pydantic.json b/services/web/server/src/simcore_service_webserver/api/v0/schemas/node-meta-v0.0.1-pydantic.json index 6a5c0c7e6c7..67043286e1a 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/schemas/node-meta-v0.0.1-pydantic.json +++ b/services/web/server/src/simcore_service_webserver/api/v0/schemas/node-meta-v0.0.1-pydantic.json @@ -33,20 +33,12 @@ "title": "Key", "description": "distinctive name for the node based on the docker registry path", "pattern": "^(simcore)/(services)/(comp|dynamic|frontend)(/[\\w/-]+)+$", - "examples": [ - "simcore/services/comp/itis/sleeper", - "simcore/services/dynamic/3dviewer" - ], "type": "string" }, "version": { "title": "Version", "description": "service version number", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", - "examples": [ - "1.0.0", - "0.0.1" - ], "type": "string" }, "integration-version": { @@ -840,7 +832,7 @@ "type": "computational", "integration-version": "1.0.0", "version": "1.7.0", - "description": "oSparc Python Runner", + "description": "oSparc Python Runner with boot options", "contact": "smith@company.com", "authors": [ { @@ -1820,4 +1812,4 @@ ] } } -} \ No newline at end of file +} diff --git a/services/web/server/src/simcore_service_webserver/api/v0/schemas/project-v0.0.1-pydantic.json b/services/web/server/src/simcore_service_webserver/api/v0/schemas/project-v0.0.1-pydantic.json index 91a645e4a7a..59102d49a22 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/schemas/project-v0.0.1-pydantic.json +++ b/services/web/server/src/simcore_service_webserver/api/v0/schemas/project-v0.0.1-pydantic.json @@ -321,6 +321,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -546,6 +547,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1093,7 +1095,6 @@ "quality": { "title": "Quality", "description": "stores the study quality assessment", - "default": {}, "type": "object" }, "dev": { @@ -1288,6 +1289,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1677,6 +1679,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } }, @@ -1902,6 +1905,7 @@ }, "label": { "title": "Label", + "description": "Display name", "type": "string" } },