Skip to content

Commit 80e6179

Browse files
committed
feat: Update ConfluenceParameters model to use model_dump_json for JSON representation
1 parent f77c144 commit 80e6179

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: extractor-api-lib/src/extractor_api_lib/models/confluence_parameters.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
class ConfluenceParameters(BaseModel):
3232
"""
33-
33+
3434
""" # noqa: E501
3535
url: StrictStr = Field(description="url of the confluence space.")
3636
token: StrictStr = Field(description="api key to access confluence.")
@@ -56,7 +56,7 @@ def to_str(self) -> str:
5656
def to_json(self) -> str:
5757
"""Returns the JSON representation of the model using alias"""
5858
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59-
return json.dumps(self.to_dict())
59+
return self.model_dump_json(by_alias=True, exclude_unset=True)
6060

6161
@classmethod
6262
def from_json(cls, json_str: str) -> Self:

0 commit comments

Comments
 (0)