# ============================================================= # API Versioning Strategy and Process to follow for API Version # ============================================================= # Step-1: For existing Controller and Action we need to use attribute routing to enable the versioning and to do so, # we need to add "RoutePrefix" attribute at controller level with expected version number. Ex: [RoutePrefix("v1/policy")] # and for action need to add "Route" attribute with expected api path. Ex: [Route("productItem")] or [Route("advance/search")] etc. # Step-2: Create a new version of the API controller by following previous version of the API controller name and pattern: [Name]V[number]Controller. Ex: PolicyV2Controller.cs # Step-2.1: Add the RoutePrefix attribute (pattern: v[number]/[controller]) for the new version of the API controller to use the new routing version or API url. # Step-2.2: Add the Route attribute for the each API action same as ActionName attribute under the new of API Controller. # Step-3: Update the WebApiConfig.cs and add new routeTemplate after MapHttpAttributeRoutes method, with the new version of the API controller to use the new routing version or API url. # Note: follow this step only when we need to customize the routing with different route attribute else this step is optional. # Step-4: Update the SwaggerConfig.cs with the new version of the API controller (under MultipleApiVersions method) to use the new routing version or API url. # This step need to follow only when adding a complete new version to API suite else not required to do every time. # Step-5: Update the Client API documentation with the new version of the API controller to share the details of the new routing version or API url. # # Notes: # As stated, /swagger takes you to the swagger UI: # If you're using Swashbuckle, then '/swagger/docs/v1' should take you to the swagger.json file - It can found using Chrome Dev tools. # If you're using Swashbuckle.AspNetCore, then the url is slightly different and that is: '/swagger/v1/swagger.json' # ============================================================= # OAuth 2.0 Authorization process # ============================================================= # #