-
Notifications
You must be signed in to change notification settings - Fork 3k
[docs] add new backcompat serialization methods to migration guide #41895
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
[docs] add new backcompat serialization methods to migration guide #41895
Conversation
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.
Pull Request Overview
This PR adds new backcompat serialization helper methods to the Azure Core SDK and updates the migration guide to document their usage.
- Export three new helper functions in
azure.core.serialization
for backward compatibility. - Introduce code examples in the migration guide showing how to use
as_attribute_dict
. - Document the new helper methods (
is_generated_model
,attribute_list
) in the guide.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
sdk/core/azure-core/azure/core/serialization.py | Updated __all__ to export is_generated_model , as_attribute_dict , and attribute_list |
doc/dev/mgmt/hybrid_model_migration.md | Added backcompat code samples and a section for additional helper methods |
Comments suppressed due to low confidence (3)
doc/dev/mgmt/hybrid_model_migration.md:277
- The Additional Helper Methods section lists is_generated_model and attribute_list but omits as_attribute_dict. Consider adding a documentation entry for as_attribute_dict to provide a complete overview of helper methods.
For edge cases and generic code that works with models, Azure Core provides these utility methods in `azure.core.serialization`:
sdk/core/azure-core/azure/core/serialization.py:14
- [nitpick] Add unit tests covering the new serialization helper methods (as_attribute_dict, is_generated_model, attribute_list) to ensure their behavior is validated across different model scenarios.
__all__ = ["NULL", "AzureJSONEncoder", "is_generated_model", "as_attribute_dict", "attribute_list"]
sdk/core/azure-core/azure/core/serialization.py:14
- The newly added names in all are not defined or imported in this module, which will cause a NameError. Ensure that is_generated_model, as_attribute_dict, and attribute_list are implemented or imported before exporting them.
__all__ = ["NULL", "AzureJSONEncoder", "is_generated_model", "as_attribute_dict", "attribute_list"]
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.
Posted some inline suggestions about the minimum core version needed for the backcompat functions.
…into core/addSerializationMethodsToAll
Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com>
No description provided.