From dedd8d847d96e794e6f57f34c7fc5805de11f4bf Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Tue, 30 Apr 2024 20:12:41 +0100 Subject: [PATCH] fix: update pydantic deprecated use of .json() --> .model_dump_json() --- osm_login_python/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osm_login_python/core.py b/osm_login_python/core.py index 00fc630..33a2a6d 100644 --- a/osm_login_python/core.py +++ b/osm_login_python/core.py @@ -40,7 +40,7 @@ def login( """ authorize_url = f"{self.osm_url}/oauth2/authorize/" login_url, _ = self.oauth.authorization_url(authorize_url) - return json.loads(Login(login_url=login_url).json()) + return json.loads(Login(login_url=login_url).model_dump_json()) def callback(self, callback_url: str) -> str: """Performs token exchange between OSM and the callback website. @@ -75,7 +75,7 @@ def callback(self, callback_url: str) -> str: token = serializer.dumps(user_data) access_token = base64.b64encode(bytes(token, "utf-8")).decode("utf-8") token = Token(access_token=access_token) - return json.loads(token.json()) + return json.loads(token.model_dump_json()) def deserialize_access_token(self, access_token: str) -> dict: """Returns the userdata as JSON from access token.