Swagger in ASP. NET Core OData interface with [FromOdataUri] params

Viewed 211

I've succesfully configured SwAgger for OData web API. All works fine for such actions like this:

        [HttpGet]
        [EnableQuery]
        public async Task<IActionResult> GetAll()

And route in Swagger UI looks like this: odata/entities

But I'm still don't know how to implement action like this:

        [HttpGet("{key}")]
        [EnableQuery]
        public async Task<IActionResult> Get([FromODataUri] string key)

Correct route should be like this: odata/entities(key)

Actual route in swagger right now is: odata/entities/{key} and it doesn't work in swagger when you try to execute request

Please help to configure Swagger UI routes for OData in correct way

0 Answers
Related