Skip to content

Conversation

@jorgerangel-msft
Copy link
Contributor

@jorgerangel-msft jorgerangel-msft commented Jan 7, 2026

contributes to #3331

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jan 7, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

No changes needing a change description found.

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>
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Member

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?

Copy link
Contributor Author

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 👍

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

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants