RicoSuter/NSwag

Route constraint shown as "string" in UI

Open

#745 opened on 2017年4月28日

GitHub で見る
 (5 comments) (1 reaction) (0 assignees)C# (6,291 stars) (1,189 forks)batch import
help wantedproject: NSwag.SwaggerGeneration.WebApitype: bug

説明

Hi, the documentation says the WebApiToSwaggerGenerator supports "RouteAttribute and ActionNameAttribute on the action method, with support for Route constraints (e.g. [Route("users/{id:int}"])".

Given the following controller action as an example:

[Route("test/{modelToUpdate:guid}")]
public IHttpActionResult UpdateTest([FromUri] TestModel modelToUpdate) {

The swagger UI shows the parameter data type for modelToUpdate as "string". Could reproduce the same if used :int as constraint. The UI always says "string".

Am I missing a special swagger attribute or something?

Thank, bergziege

コントリビューターガイド