aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Startup.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-23 16:12:33 +0800
committercrupest <crupest@outlook.com>2020-08-23 16:12:33 +0800
commited5b550e8a19be250952371c60e1c1f3d2864a1e (patch)
tree7a4e61e0dc98a030a9350dc4f8339c6efbb65a6b /Timeline/Startup.cs
parentc28848a35b0f31a59f9d02641571495822ad0db8 (diff)
downloadtimeline-ed5b550e8a19be250952371c60e1c1f3d2864a1e.tar.gz
timeline-ed5b550e8a19be250952371c60e1c1f3d2864a1e.tar.bz2
timeline-ed5b550e8a19be250952371c60e1c1f3d2864a1e.zip
Add error code to swagger description.
Diffstat (limited to 'Timeline/Startup.cs')
-rw-r--r--Timeline/Startup.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Timeline/Startup.cs b/Timeline/Startup.cs
index 86bdaf54..cbca01d0 100644
--- a/Timeline/Startup.cs
+++ b/Timeline/Startup.cs
@@ -104,6 +104,7 @@ namespace Timeline
document.DocumentName = "Timeline";
document.Title = "Timeline REST API Reference";
document.Version = typeof(Startup).Assembly.GetName().Version?.ToString() ?? "unknown version";
+ document.DocumentProcessors.Add(new DocumentDescriptionDocumentProcessor());
document.DocumentProcessors.Add(
new SecurityDefinitionAppender("JWT",
new OpenApiSecurityScheme
@@ -111,7 +112,7 @@ namespace Timeline
Type = OpenApiSecuritySchemeType.ApiKey,
Name = "Authorization",
In = OpenApiSecurityApiKeyLocation.Header,
- Description = "Type into the textbox: Bearer {your JWT token}."
+ Description = "Create token via `/api/token/create` ."
}));
document.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("JWT"));
document.OperationProcessors.Add(new DefaultDescriptionOperationProcessor());
@@ -153,7 +154,7 @@ namespace Timeline
}
app.UseOpenApi();
- app.UseSwaggerUi3();
+ app.UseReDoc();
app.UseAuthentication();
app.UseAuthorization();