简体   繁体   中英

Is it possible to do versioning with swagger/Swashbuckle using directory based version (webapi /C#)?

Is it possible using swagger/Swashbuckle to have MultipleApiVersions using only the project path and not using the attributtes [RoutePrefix...] and [Route("function")] ?

我的webapi

In this case i would like to have the following sctructure, for version 1 and version 2

预期的摇摇欲坠的布局

the project hierarchy

项目层次

The problem is , we have a webapi with a lot of controllers and each controller also have a lot of services.

This services are already deployed and used for several clients, now we need to maintain various versions of the code to supply several code versions at same time ...

so, our idea is, with a minimal impact on code, that is, not populate all exposed functions with the version attribute [RoutePrefix("v2")] and Route attribute,

and with a automatically manner expose the various code versions residing in specific directories ...

Thanks in advance.

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