diff --git a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py index 294ea360e58..bbb5d52f906 100644 --- a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py +++ b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py @@ -1,8 +1,7 @@ from datetime import datetime from decimal import Decimal -from typing import Annotated -from pydantic import BaseModel, ConfigDict, PlainSerializer +from pydantic import BaseModel, ConfigDict from ..resource_tracker import ( HardwareInfo, @@ -19,9 +18,7 @@ class PricingUnitGet(BaseModel): pricing_unit_id: PricingUnitId unit_name: str unit_extra_info: UnitExtraInfo - current_cost_per_unit: Annotated[ - Decimal, PlainSerializer(float, return_type=float, when_used="json") - ] + current_cost_per_unit: Decimal current_cost_per_unit_id: PricingUnitCostId default: bool specific_info: HardwareInfo diff --git a/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py b/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py index bdf0992910e..3eea55c6d67 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py @@ -1,8 +1,7 @@ from datetime import datetime from decimal import Decimal -from typing import Annotated -from pydantic import BaseModel, ConfigDict, Field, PlainSerializer +from pydantic import BaseModel, ConfigDict, Field from ..projects import ProjectID from ..projects_nodes_io import NodeID @@ -50,9 +49,7 @@ class PricingUnitGet(OutputSchema): pricing_unit_id: PricingUnitId unit_name: str unit_extra_info: UnitExtraInfo - current_cost_per_unit: Annotated[ - Decimal, PlainSerializer(float, return_type=float, when_used="json") - ] + current_cost_per_unit: Decimal default: bool diff --git a/packages/models-library/src/models_library/api_schemas_webserver/wallets.py b/packages/models-library/src/models_library/api_schemas_webserver/wallets.py index 21fe990b88b..c9460ab74c1 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/wallets.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/wallets.py @@ -1,15 +1,8 @@ from datetime import datetime from decimal import Decimal -from typing import Annotated, Literal, TypeAlias +from typing import Literal, TypeAlias -from pydantic import ( - ConfigDict, - Field, - HttpUrl, - PlainSerializer, - ValidationInfo, - field_validator, -) +from pydantic import ConfigDict, Field, HttpUrl, ValidationInfo, field_validator from ..basic_types import AmountDecimal, IDStr, NonNegativeDecimal from ..users import GroupID @@ -20,9 +13,9 @@ class WalletGet(OutputSchema): wallet_id: WalletID name: IDStr - description: str | None + description: str | None = None owner: GroupID - thumbnail: str | None + thumbnail: str | None = None status: WalletStatus created: datetime modified: datetime @@ -31,7 +24,7 @@ class WalletGet(OutputSchema): class WalletGetWithAvailableCredits(WalletGet): - available_credits: Annotated[Decimal, PlainSerializer(float)] + available_credits: Decimal class WalletGetPermissions(WalletGet): diff --git a/services/api-server/openapi.json b/services/api-server/openapi.json index 20210a69dba..e87fda69545 100644 --- a/services/api-server/openapi.json +++ b/services/api-server/openapi.json @@ -6492,7 +6492,7 @@ "$ref": "#/components/schemas/UnitExtraInfo" }, "currentCostPerUnit": { - "type": "number", + "type": "string", "title": "Currentcostperunit" }, "default": { @@ -7093,7 +7093,7 @@ "title": "Modified" }, "availableCredits": { - "type": "number", + "type": "string", "title": "Availablecredits" } }, diff --git a/services/resource-usage-tracker/tests/unit/api_rest/test__oas_spec.py b/services/resource-usage-tracker/tests/unit/api_rest/test__oas_spec.py deleted file mode 100644 index 3952db4c4cc..00000000000 --- a/services/resource-usage-tracker/tests/unit/api_rest/test__oas_spec.py +++ /dev/null @@ -1,29 +0,0 @@ -# pylint: disable=redefined-outer-name -# pylint: disable=unused-argument -# pylint: disable=unused-variable - -import json -from pathlib import Path -from unittest import mock - -from fastapi.testclient import TestClient - - -def test_openapi_json_is_in_sync_with_app_oas( - disabled_database: None, - disabled_prometheus: None, - disabled_rabbitmq: None, - mocked_redis_server: None, - mocked_setup_rabbitmq: mock.MagicMock, - client: TestClient, - project_slug_dir: Path, -): - """ - If this test fails, just 'make openapi.json' - """ - spec_from_app = client.app.openapi() - open_api_json_file = project_slug_dir / "openapi.json" - stored_openapi_json_file = json.loads(open_api_json_file.read_text()) - assert ( - spec_from_app == stored_openapi_json_file - ), "rerun `make openapi.json` and check differences" diff --git a/services/web/server/VERSION b/services/web/server/VERSION index 301092317fe..421ab545d9a 100644 --- a/services/web/server/VERSION +++ b/services/web/server/VERSION @@ -1 +1 @@ -0.46.0 +0.47.0 diff --git a/services/web/server/setup.cfg b/services/web/server/setup.cfg index 0c5bbbcb6b3..628685e0ad5 100644 --- a/services/web/server/setup.cfg +++ b/services/web/server/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.46.0 +current_version = 0.47.0 commit = True message = services/webserver api version: {current_version} → {new_version} tag = False 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 49278e0f128..29338d83996 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 @@ -2,7 +2,7 @@ openapi: 3.1.0 info: title: simcore-service-webserver description: Main service with an interface (http-API & websockets) to the web front-end - version: 0.46.0 + version: 0.47.0 servers: - url: '' description: webserver @@ -11314,7 +11314,7 @@ components: unitExtraInfo: $ref: '#/components/schemas/UnitExtraInfo-Output' currentCostPerUnit: - type: number + type: string title: Currentcostperunit default: type: boolean @@ -11358,7 +11358,7 @@ components: unitExtraInfo: $ref: '#/components/schemas/UnitExtraInfo-Output' currentCostPerUnit: - type: number + type: string title: Currentcostperunit default: type: boolean @@ -14079,7 +14079,7 @@ components: format: date-time title: Modified availableCredits: - type: number + type: string title: Availablecredits type: object required: