Skip to content

Commit

Permalink
nullcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus committed Aug 26, 2022
1 parent 0bfe2dd commit b5cf169
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Tzkt.Api/Swagger/Swagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@ public static void AddOpenApiDocument(this IServiceCollection services)
Description = File.Exists("Swagger/WsGetStarted.md")
? File.ReadAllText("Swagger/WsGetStarted.md")
: null,
ExtensionData = {{"tzkt-category", "ws"}}
ExtensionData = {{"x-tagGroup", "ws"}}
});
document.Tags.Add(new NSwag.OpenApiTag
{
Name = "Subscriptions",
Description = File.Exists("Swagger/WsSubscriptions.md")
? File.ReadAllText("Swagger/WsSubscriptions.md")
: null,
ExtensionData = {{"tzkt-category", "ws"}}
ExtensionData = {{"x-tagGroup", "ws"}}
});
document.Tags.Add(new NSwag.OpenApiTag
{
Name = "Examples",
Description = File.Exists("Swagger/WsExamples.md")
? File.ReadAllText("Swagger/WsExamples.md")
: null,
ExtensionData = {{"tzkt-category", "ws"}}
ExtensionData = {{"x-tagGroup", "ws"}}
});
document.Tags.Add(new NSwag.OpenApiTag
{
Name = "Typescript SDK",
Description = File.Exists("Swagger/TypescriptSdk.md")
? File.ReadAllText("Swagger/TypescriptSdk.md")
: null,
ExtensionData = {{"tzkt-category", "sdk"}}
ExtensionData = {{"x-tagGroup", "sdk"}}
});
document.ExtensionData = new Dictionary<string, object>
{
Expand All @@ -82,15 +82,15 @@ public static void AddOpenApiDocument(this IServiceCollection services)
{
name = "WebSocket API",
tags = document.Tags
.Where(x => x.ExtensionData["tzkt-category"].Equals("ws"))
.Where(x => x.ExtensionData != null && x.ExtensionData["x-tagGroup"].Equals("ws"))
.Select(x => x.Name)
.ToList()
},
new
{
name = "Libraries",
tags = document.Tags
.Where(x => x.ExtensionData["tzkt-category"].Equals("sdk"))
.Where(x => x.ExtensionData != null && x.ExtensionData["x-tagGroup"].Equals("sdk"))
.Select(x => x.Name)
.ToList()
}
Expand Down

0 comments on commit b5cf169

Please sign in to comment.