RicoSuter/NSwag

Route constraint shown as "string" in UI

Open

#745 创建于 2017年4月28日

在 GitHub 查看
 (5 评论) (1 反应) (0 负责人)C# (6,291 star) (1,189 fork)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

贡献者指南