-
Notifications
You must be signed in to change notification settings - Fork 329
XML Serialization Proposal #9307
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
base: main
Are you sure you want to change the base?
Conversation
|
No changes needing a change description found. |
120a7c1 to
a83aa5b
Compare
| For Azure branded libraries, models that support XML will also implement Azure Core's `IXmlSerializable` and the existing `IJsonModel<T>`: | ||
|
|
||
| ```csharp | ||
| public partial class Dog : IXmlSerializable, IJsonModel<Dog> |
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.
Would all XML models implement IJsonModel even if the service only supports XML?
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.
yeah that is the current behavior. The generator will always generate at least JSON serialization for models.
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.
Note this will be a change to the current behavior for libraries like Storage where they currently only have XML serialization. We may want to run this by KC.
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.
Why would we not implement only IPersistableModel on XML models?
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.
I'm fine with just supporting XML serialization if JSON is not explicitly specified, and have these models implement IPersistableModel. I was just conforming to the existing generator pattern, where we always generate JSON serialization for all models. We can always add JSON serialization support if needed in the future 👍
contributes to #3331