[Bug]: bytes data type isn't recognized properly #5704
Labels
bug
Something isn't working
needs-area
needs-info
Mark an issue that needs reply from the author or it will be closed automatically
Describe the bug
We're using TypeSpec to auto-generate c# classes. However, there is a problem with the auto-generated
.Equals
method. In the default .mustache file of the openapi generator, there's a check for#isContainer
which determins, if a regular==
comparison or.SequenceEqual
should be used:However, contrary to my expectation for the
bytes
data type, it doesn't use theSequenceEqual
comparison, but the regular==
one, which doesn't work for byte arrays in c#. Why is that?bytes
gets converted into atype: string, format: byte
data type, which seems odd to me. Is that right?Right now, it correctly generates a property of type
byte[]
in c#, but the equals method doesn't work, as it uses.Equals
instead of the correctSequenceEqual
.Reproduction
Checklist
The text was updated successfully, but these errors were encountered: