Skip to content

Commit

Permalink
Use get_type_adapter in get_typed (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
pederhan authored Dec 9, 2024
1 parent ceaefb9 commit 5ac8eeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mreg_cli/utilities/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
)
from mreg_cli.outputmanager import OutputManager
from mreg_cli.tokenfile import TokenFile
from mreg_cli.types import Json, JsonMapping, QueryParams
from mreg_cli.types import Json, JsonMapping, QueryParams, get_type_adapter

session = requests.Session()
session.headers.update({"User-Agent": f"mreg-cli-{__version__}"})
Expand Down Expand Up @@ -576,7 +576,7 @@ def get_typed(
:returns: An instance of `type_` populated with data from the response.
"""
adapter = TypeAdapter(type_)
adapter = get_type_adapter(type_)
if type_ is list or get_origin(type_) is list:
resp = get_list(path, params=params, limit=limit)
return adapter.validate_python(resp)
Expand Down

0 comments on commit 5ac8eeb

Please sign in to comment.