Skip to content

Commit

Permalink
Obsolete支持NSwag #8
Browse files Browse the repository at this point in the history
  • Loading branch information
vipwan committed Oct 16, 2023
1 parent 05fa097 commit 7acac98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Biwen.QuickApi.DemoWeb/Apis/HelloApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ public override async Task<HelloApiResponse> ExecuteAsync(EmptyRequest request)
/// 默认不需要Group
/// </summary>
[QuickApi("world5", Verbs = Verb.GET)]
[QuickApiSummary("过期测试", "过期测试",IsDeprecated =true)]
[Obsolete("过期测试",false)]
public class Hello5Api : BaseQuickApi
{
public override async Task<EmptyResponse> ExecuteAsync(EmptyRequest request)
Expand Down
5 changes: 5 additions & 0 deletions Biwen.QuickApi/Swagger/QuickApiOperationProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public bool Process(OperationProcessorContext context)
}
}

if (kuickApiDef.QuickApiType?.GetCustomAttribute<ObsoleteAttribute>() != null)
{
op.IsDeprecated = true;//标注为已过时
}

//fix request content-types not displaying correctly
if (reqContent?.Count > 0)
{
Expand Down

0 comments on commit 7acac98

Please sign in to comment.