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(pydantic): python unwrap properties #2111

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

memdal
Copy link

@memdal memdal commented Oct 23, 2024

Description

Pydantic code generation now checks if data is a dict or an object before getting keys in the unwrap functions.

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 3b24e63
🔍 Latest deploy log https://app.netlify.com/sites/modelina/deploys/671a460383ad860008efa281

@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 from 2f8a06b to 23d2168 Compare October 24, 2024 09:03
@memdal memdal force-pushed the fix-python-unwrap-properties branch from 23d2168 to 3b24e63 Compare October 24, 2024 13:05
Copy link

sonarcloud bot commented Oct 24, 2024

@memdal memdal requested a review from maxplatov October 24, 2024 13:28
@@ -114,7 +117,7 @@ def unwrap_${dictionaryModel?.propertyName}(cls, data):
.map((value) => `'${value.unconstrainedPropertyName}'`)
.join(', ')}]
${dictionaryModel?.propertyName} = {}
for obj_key in list(data.keys()):
for obj_key in cls.list_keys(data):

Choose a reason for hiding this comment

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

I still believe that this code will never called due to condition above
if len(unknown_object_properties) == 0:

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

Successfully merging this pull request may close these issues.

2 participants