-
Notifications
You must be signed in to change notification settings - Fork 323
Closed
openai/openai-dotnet
#728Labels
emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpIssue for the C# client emitter: @typespec/http-client-csharp
Description
See https://github.com/openai/openai-dotnet/blob/d66058ce4b7cdc41e3d7a59f317941bbbf22cbd2/src/Generated/Models/Chat/ChatMessageContentPart.Serialization.cs#L24-L25. This model has custom serialization code, and the generated code ends up looking like:
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<ChatMessageContentPart>)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
throw new FormatException($"The model {nameof(ChatMessageContentPart)} does not support writing '{format}' format.");
}
#pragma warning disable SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
#pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
}Metadata
Metadata
Assignees
Labels
emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpIssue for the C# client emitter: @typespec/http-client-csharp