Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure API App client is not generating enums

I hava swagger generated by Swashbuckle from my WebApi service. It all looks fine in terms of types and so on..., however when I generate the proxy classes using Azure API App client it lacks the enum declarions. When I double-checked it was there in swagger but in resulting classes there was only a string representation of them (string property instead of enum property) and no declaration of enum type.

like image 889
Dave Avatar asked Sep 09 '15 08:09

Dave


1 Answers

In the AutoREST release that is on GitHub (https://github.com/Azure/AutoRest) and will be included in a future Update of VS, we will at least put in the enum values as XML documentation comments. That way you get IntelliSense.

The reason we generally discourage enums is versioning reasons. If you want to support a new enum value on the server, it is a breaking change to the client.

like image 191
Mohit Srivastava Avatar answered Sep 20 '22 13:09

Mohit Srivastava