RicoSuter/NSwag

Route constraint shown as "string" in UI

开放

#745 创建于 2017年4月28日

 (5 条评论) (1 个反应) (0 位负责人)C# (1,356 个派生)batch import
help wantedproject: NSwag.SwaggerGeneration.WebApitype: bug

仓库指标

星标
 (7,358 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南