Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
273 stars 55 forks source link

FableConverter incorrectly lowercases [<StringEnum(CaseRules.None)>] #126

Open 0x53A opened 5 years ago

0x53A commented 5 years ago

As the title says, I have an enum:

[<StringEnum(CaseRules.None)>]
type Camera = FirstPerson | ArcRotate | IsometricTopDown

FableConverter then lowercases it anyway, causing issues on the client

https://github.com/Zaid-Ajaj/Fable.Remoting/blob/a9f65b819c02200fd42a3c4b7762d91842804e52/Fable.Remoting.Json/FableConverter.fs#L215-L221

0x53A commented 5 years ago

Workaround:

[<StringEnum(CaseRules.None)>]
type Camera =
| [<CompiledName("FirstPerson")>] FirstPerson
| [<CompiledName("ArcRotate")>] ArcRotate
| [<CompiledName("IsometricTopDown")>] IsometricTopDown
Zaid-Ajaj commented 5 years ago

Hello @0x53A thanks a lot for reporting the issue. I am glad you found a workaround. I will get to solving it shortly :smile: