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

fix: python pydantic unwrap properties #2111

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

memdal
Copy link

@memdal memdal commented Oct 23, 2024

Description

  1. Pydantic code generation now checks if data is a dict or an object before getting keys in the unwrap functions.
  2. Alias has been removed for unconstrained properties so that Pydantic objects can follow idiomatic casing for the additional_properties property:
MyPydanticObject(
    defined_property=1,
    additional_properties={
        "undefined_property": "2"
    }
)

Checklist

  • The code follows the project's coding standards and is properly linted (npm run lint).
  • Tests have been added or updated to cover the changes.
  • Documentation has been updated to reflect the changes.
  • All tests pass successfully locally.(npm run test).

Additional Notes

@memdal memdal changed the base branch from master to next October 23, 2024 13:35
Copy link

netlify bot commented Oct 23, 2024

Deploy Preview for modelina canceled.

Name Link
🔨 Latest commit 18baf39
🔍 Latest deploy log https://app.netlify.com/sites/modelina/deploys/6720dd8ce793e60008f34c76

@memdal memdal changed the title Fix python unwrap properties fix(pydantic): python unwrap properties Oct 23, 2024
@memdal memdal force-pushed the fix-python-unwrap-properties branch 2 times, most recently from 23d2168 to 3b24e63 Compare October 24, 2024 13:05
@memdal memdal requested a review from maxplatov October 24, 2024 13:28
@memdal memdal force-pushed the fix-python-unwrap-properties branch from 3b24e63 to 18baf39 Compare October 29, 2024 13:05
Copy link

sonarcloud bot commented Oct 29, 2024

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

@maxplatov want to have another look?

Copy link

@maxplatov maxplatov left a comment

Choose a reason for hiding this comment

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

Looks good for me

@jonaslagoni jonaslagoni changed the title fix(pydantic): python unwrap properties fix: python pydantic unwrap properties Oct 30, 2024
@jonaslagoni jonaslagoni merged commit 9f2b80e into asyncapi:next Oct 30, 2024
31 of 34 checks passed
@jonaslagoni
Copy link
Member

@all-contributors please add @memdal for code, test

Copy link
Contributor

@jonaslagoni

@memdal already contributed before to code, test

@jonaslagoni
Copy link
Member

@all-contributors please add @maxplatov for review

Copy link
Contributor

@jonaslagoni

I've put up a pull request to add @maxplatov! 🎉

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 4.0.0-next.63 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants