@@ -50,7 +50,7 @@ class ClientConfigV1Alpha1(BaseModel):
5050 token : str
5151 grpcOptions : dict [str , str | int ] | None = Field (default_factory = dict )
5252
53- useAlternativeEndpoints : bool = False
53+ use_alternative_endpoints : bool = Field ( alias = "useAlternativeEndpoints" , default = False )
5454
5555 drivers : ClientConfigV1Alpha1Drivers
5656
@@ -174,7 +174,7 @@ async def lease_async(
174174 release = release_lease ,
175175 tls_config = self .tls ,
176176 grpc_options = self .grpcOptions ,
177- use_alternative_endpoints = self .useAlternativeEndpoints ,
177+ use_alternative_endpoints = self .use_alternative_endpoints ,
178178 ) as lease :
179179 yield lease
180180
@@ -238,12 +238,27 @@ def save(cls, config: Self, path: Optional[os.PathLike] = None) -> Path:
238238 else :
239239 config .path = Path (path )
240240 with config .path .open (mode = "w" ) as f :
241- yaml .safe_dump (config .model_dump (mode = "json" , exclude = {"path" , "alias" }), f , sort_keys = False )
241+ yaml .safe_dump (
242+ config .model_dump (
243+ mode = "json" ,
244+ exclude = {"path" , "alias" },
245+ by_alias = True ,
246+ ),
247+ f ,
248+ sort_keys = False ,
249+ )
242250 return config .path
243251
244252 @classmethod
245253 def dump_yaml (cls , config : Self ) -> str :
246- return yaml .safe_dump (config .model_dump (mode = "json" , exclude = {"path" , "alias" }), sort_keys = False )
254+ return yaml .safe_dump (
255+ config .model_dump (
256+ mode = "json" ,
257+ exclude = {"path" , "alias" },
258+ by_alias = True ,
259+ ),
260+ sort_keys = False ,
261+ )
247262
248263 @classmethod
249264 def exists (cls , alias : str ) -> bool :
0 commit comments