Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug-fix: Handle changes to OpenAPI models when pydantic v2 is installed #82

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

davidjwbbc
Copy link
Contributor

This fixes the issue where the AS would abort when it was configured because the object to JSON string conversion function no longer takes json.dumps() keyword arguments in pydantic v2.

The fix will detect if the pydantic v2 model_dump() method is available on the object and adapt the way in which it generates the JSON string appropriately.

This also fixes another issue with pydantic v2 now using a Url class to model URL properties instead of a string.

Closes #81

@davidjwbbc davidjwbbc added the bug Something isn't working label Dec 20, 2023
@davidjwbbc davidjwbbc self-assigned this Dec 20, 2023
Copy link
Contributor

@rjb1000 rjb1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation, @davidjwbbc.

@davidjwbbc davidjwbbc merged commit 4ebaa7b into 5G-MAG:development Dec 20, 2023
@davidjwbbc davidjwbbc deleted the bug-fix/pydantic_v2 branch December 20, 2023 15:09
@davidjwbbc davidjwbbc linked an issue Dec 20, 2023 that may be closed by this pull request
@davidjwbbc davidjwbbc mentioned this pull request Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

change in pydantic v2
2 participants