Skip to content

Commit b5c51b1

Browse files
committed
refactored storage api generator
1 parent 7b71157 commit b5c51b1

File tree

5 files changed

+11
-1642
lines changed

5 files changed

+11
-1642
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DEFAULT_GOAL := all
12

23
.PHONY: _check_venv_active
34
_check_venv_active:
@@ -6,13 +7,12 @@ _check_venv_active:
67

78

89
.PHONY: install
9-
install: _check_venv_active
10-
@cd ./../../../../services/storage && make install-dev && cd -
10+
install-dev install: _check_venv_active
11+
# installing storage and requirements.txt
12+
@cd ./../../../services/storage && make install-dev && cd -
1113
@uv pip install -r requirements.txt
1214

1315

1416
.PHONY: all
15-
all: _check_venv_active
16-
@for file in *.py; do \
17-
python $$file; \
18-
done
17+
all: _check_venv_active install
18+
python openapi.py

api/specs/storage/scripts/storage.py renamed to api/specs/storage/openapi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from models_library.projects_nodes_io import LocationID, StorageFileID
2828
from models_library.users import UserID
2929
from pydantic import AnyUrl, ByteSize
30+
from servicelib.fastapi.openapi import create_openapi_specs
3031
from servicelib.long_running_tasks._models import TaskGet, TaskId, TaskStatus
3132
from settings_library.s3 import S3Settings
3233
from simcore_service_storage._meta import API_VTAG
@@ -35,6 +36,7 @@
3536
FileMetaData,
3637
SearchFilesQueryParams,
3738
)
39+
from simcore_service_storage.resources import storage_resources
3840

3941
TAGS_DATASETS: list[str | Enum] = ["datasets"]
4042
TAGS_FILES: list[str | Enum] = ["files"]
@@ -401,6 +403,7 @@ async def cancel_and_delete_task(task_id: TaskId):
401403

402404

403405
if __name__ == "__main__":
404-
from _common import CURRENT_DIR, create_openapi_specs
406+
openapi = create_openapi_specs(app, drop_fastapi_default_422=True)
405407

406-
create_openapi_specs(app, CURRENT_DIR.parent / "openapi.yaml")
408+
oas_path = storage_resources.get_path("api/v0/openapi.yaml").resolve()
409+
print(f"Writing {oas_path}...", end=None)

0 commit comments

Comments
 (0)