简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM