You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an union model property type is customized to an extensible enum of more than 1 type, ie public readonly partial struct HyperparameterCycleCount : IEquatable<int>, IEquatable<string> the underlying model is generating deserialization code that doesn't compile.
.
Similarly, the serialization code is generated incorrectly.
jorgerangel-msft
changed the title
Incorrect Deserialization Code is Generated For Extensible Enums of Union Type
Incorrect serialization Code is Generated For Extensible Enums of Union Type
Jan 7, 2025
When an union model property type is customized to an extensible enum of more than 1 type, ie
public readonly partial struct HyperparameterCycleCount : IEquatable<int>, IEquatable<string>
the underlying model is generating deserialization code that doesn't compile..
Similarly, the serialization code is generated incorrectly.
Sample spec: https://github.com/mikhail/openai-in-typespec/blob/c22818b1e6d61ffde44d19501e0ebacb13559eb9/.typespec/fine-tuning/custom.tsp#L5.
Sample generated code: https://github.com/mikhail/openai-in-typespec/blob/c22818b1e6d61ffde44d19501e0ebacb13559eb9/.dotnet/src/Generated/Models/HyperparameterOptions.Serialization.cs#L97
The text was updated successfully, but these errors were encountered: