Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔨 Maintenance: missing updates in schemas #4066

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions api/specs/common/schemas/node-meta-v0.0.1-pydantic.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": "[email protected]",
"authors": [
{
Expand Down Expand Up @@ -1820,4 +1812,4 @@
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ properties:
title: Prjowner
type: string
quality:
default: {}
description: stores the study quality assessment
title: Quality
type: object
Expand Down Expand Up @@ -479,6 +478,7 @@ properties:
title: Downloadlink
type: string
label:
description: Display name
title: Label
type: string
required:
Expand Down Expand Up @@ -642,6 +642,7 @@ properties:
title: Downloadlink
type: string
label:
description: Display name
title: Label
type: string
required:
Expand Down
6 changes: 5 additions & 1 deletion api/specs/common/schemas/project-v0.0.1-pydantic.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -546,6 +547,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -1093,7 +1095,6 @@
"quality": {
"title": "Quality",
"description": "stores the study quality assessment",
"default": {},
"type": "object"
},
"dev": {
Expand Down Expand Up @@ -1288,6 +1289,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -1677,6 +1679,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -1902,6 +1905,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down
41 changes: 31 additions & 10 deletions api/specs/common/schemas/scripts/remove_definitions.py
Original file line number Diff line number Diff line change
@@ -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,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,6 @@ components:
title: Prjowner
type: string
quality:
default: {}
description: stores the study quality assessment
title: Quality
type: object
Expand Down Expand Up @@ -1627,6 +1626,7 @@ components:
title: Downloadlink
type: string
label:
description: Display name
title: Label
type: string
required:
Expand Down Expand Up @@ -1781,6 +1781,7 @@ components:
title: Downloadlink
type: string
label:
description: Display name
title: Label
type: string
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": "[email protected]",
"authors": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -546,6 +547,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -1093,7 +1095,6 @@
"quality": {
"title": "Quality",
"description": "stores the study quality assessment",
"default": {},
"type": "object"
},
"dev": {
Expand Down Expand Up @@ -1288,6 +1289,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -1677,6 +1679,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down Expand Up @@ -1902,6 +1905,7 @@
},
"label": {
"title": "Label",
"description": "Display name",
"type": "string"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,6 @@ paths:
title: Prjowner
type: string
quality:
default: {}
description: stores the study quality assessment
title: Quality
type: object
Expand Down Expand Up @@ -2888,6 +2887,7 @@ paths:
title: Downloadlink
type: string
label:
description: Display name
title: Label
type: string
required:
Expand Down Expand Up @@ -3042,6 +3042,7 @@ paths:
title: Downloadlink
type: string
label:
description: Display name
title: Label
type: string
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": "[email protected]",
"authors": [
{
Expand Down Expand Up @@ -1820,4 +1812,4 @@
]
}
}
}
}
Loading