File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
services/web/server/src/simcore_service_webserver Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1212from models_library .basic_types import NonNegativeDecimal
1313from models_library .emails import LowerCaseEmailStr
1414from models_library .products import ProductName , StripePriceID , StripeTaxRateID
15- from models_library .utils .change_case import snake_to_camel
1615from pydantic import (
1716 BaseModel ,
1817 BeforeValidator ,
@@ -305,12 +304,11 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
305304 )
306305
307306 model_config = ConfigDict (
308- alias_generator = snake_to_camel ,
307+ # NOTE: do not add aliases. Use ProductGet schema for rest API
309308 from_attributes = True ,
310309 frozen = True ,
311310 json_schema_extra = _update_json_schema_extra ,
312311 str_strip_whitespace = True ,
313- validate_by_alias = True ,
314312 validate_by_name = True ,
315313 extra = "ignore" ,
316314 )
@@ -337,13 +335,12 @@ def to_statics(self) -> dict[str, Any]:
337335 },
338336 exclude_none = True ,
339337 exclude_unset = True ,
340- by_alias = True ,
341338 )
342339
343340 def get_template_name_for (self , filename : str ) -> str | None :
344341 """Checks for field marked with 'x_template_name' that fits the argument"""
345342 template_name = filename .removesuffix (".jinja2" )
346- for name , field in self .model_fields .items ():
343+ for name , field in self .__class__ . model_fields .items ():
347344 if (
348345 field .json_schema_extra
349346 and field .json_schema_extra .get ("x_template_name" ) == template_name # type: ignore[union-attr]
Original file line number Diff line number Diff line change 77from aiohttp .client import ClientSession
88from aiohttp .client_exceptions import ClientConnectionError , ClientError
99from common_library .json_serialization import json_dumps
10+ from models_library .utils .change_case import snake_to_camel
1011from packaging .version import Version
1112from servicelib .aiohttp .client_session import get_client_session
1213from tenacity .asyncio import AsyncRetrying
@@ -122,7 +123,9 @@ async def create_and_cache_statics_json(app: web.Application) -> None:
122123 data = deepcopy (common )
123124
124125 _logger .debug ("Product %s" , product .name )
125- data .update (product .to_statics ())
126+
127+ product_data = {snake_to_camel (k ): v for k , v in product .to_statics ().items ()}
128+ data .update (product_data )
126129
127130 # Adds specifics to login settings
128131 if (p := product .login_settings ) and (v := p .get ("LOGIN_2FA_REQUIRED" , None )):
You can’t perform that action at this time.
0 commit comments