将标头添加到Swagger标记

时间:2018-04-13 20:55:45

标签: c# .net swagger-ui

我有以下招摇标记:

    /// <summary>
    /// Do something
    /// </summary>      
    /// <remarks>
    /// The following headers can be used for a successful call:
    ///     Date: Tue, 25 Apr 2017 11:48:25 GMT
    ///     X-Served-Store: 286
    ///     X-Served-Till: 01
    ///     X-Served-By: 003030
    ///     X-Served-On: Tue, 25 Apr 2017 10:14:29 GMT
    ///     X-API-Key: ZWZjZmU2ODAtMzRhOS00ZjM1LWFmNTEtZDRjMWQxZmZhMzU3
    ///     Authorization: 12345:bCRrjBcmYN7Lk6Nc30o/TBkx2U6NHTH2P/wngsRRvz4=
    ///     Host: localhost:57127
    ///     Accept-Language:en-ca
    /// </remarks>
    /// <returns>List of Stuff</returns>       
    /// <response code="200">List is returned</response>        
    /// <response code="404">List is empty</response>   [Route("tender")]
    [ProducesResponseType(typeof(List<ReturnTenderType>), 200)]
    [ProducesResponseType(typeof(ErrorResponseList), 404)]
    [ProducesResponseType(typeof(ErrorResponseList), 406)]
    [ProducesResponseType(typeof(ErrorResponseList), 500)]
    [ProducesResponseType(typeof(ErrorResponseList), 503)]
    [HttpGet]
    public IActionResult GetTenderTypes() 

我想添加&#34; Accept-Language&#34;仅限此端点的标头。我试过了<header name="Accept-Language"></header>,但这似乎无法奏效。

帮助?!

0 个答案:

没有答案