ASP.NET Core OData Swagger Guide

Get started

https://github.com/Microsoft/aspnet-api-versioning/tree/master/samples/aspnetcore/SwaggerODataSample

Customize Swagger UI index.html

sometime we need customize Swagger UI Index.hmtl, such as remove css link ‘https://fonts.googleapis.com/css'

https://github.com/domaindrivendev/Swashbuckle.AspNetCore#customize-indexhtml

Same name function in different Controller

you must use attributroute like this:

1
2
3
4
[ODataRoute("funcname(par1={par1})")]
public IAcitionResult FuncName(int par1){
return OK(part1);
}

Parameter type should be path but shown as query

you must set [FromRoute] attribute for the parameter like this

1
2
3
4
[ODataRoute("funcname(par1={par1})")]
public IActionResult FuncName([FromRoute]int par1){
return OK(part1);
}