根據documentation for Swashbuckle,最新版本只支持一些XML註釋。看起來好像XML的評論,如<example>
或<see>
目前不支持but will be implemented in Swashbuckle v6。在描述中添加鏈接到Swagger中的其他操作(通過Swashbuck)
在那之前,有沒有一種解決方法可以模仿<example>
或<see>
的行爲?
我想以某種方式在端點模型下列出的enum的<summary>
中添加一個鏈接(使用<see>
with cref)以指向枚舉的相應端點(Swagger中的另一個端點,獲取該枚舉類型的列表)。
編輯(不知道如何在註釋格式):
我想揚鞭檢測<see>
並顯示在枚舉的描述鏈接到不同的端點
/// <summary>
/// Generic description.
/// Find enum types <see cref="ContactEntityType">here</see>
/// </summary>
[PropertyRequired, PropertyStringAsEnum(typeof(ContactEntityType))]
[DataMember(Name = "entityType")]
public NamedReference EntityType { get; set; }
我一直對我的叉子Swashbuckle和我們添加了對示例的支持:https://github.com/heldersepu/Swagger-Net/blob/master/Tests/Swagger.Net.Dummy.Core/Controllers/AnnotatedTypesContro ller.cs#L28 – HelderSepu
你可以給我一個完整的樣本,你將如何使用 –
HelderSepu
我在原始問題 –