-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for modelina ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Quality Gate failedFailed conditions |
@@ -101,7 +101,7 @@ def custom_serializer(self, handler): | |||
@model_validator(mode='before') | |||
@classmethod | |||
def unwrap_${dictionaryModel?.propertyName}(cls, data): | |||
json_properties = list(data.keys()) | |||
json_properties = list(data.model_dump().keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your code have to support dict(how it was before) and pydantic model
@@ -32,7 +32,7 @@ exports[`PYTHON_PYDANTIC_PRESET should render pydantic for class 1`] = ` | |||
|
|||
known_json_properties = ['prop', 'additionalProperties'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code will never called because keys()
doesn't return elements inside additionalProperties
, then len(unknown_object_properties) == 0
is always true
Description
Gets the dict from data as this is a pydantic object.
Checklist
npm run lint
).npm run test
).Additional Notes