Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TS SDK page to the docs
Browse files Browse the repository at this point in the history
m-kus committed Aug 26, 2022
1 parent 35c1f9f commit 0bfe2dd
Showing 2 changed files with 447 additions and 4 deletions.
30 changes: 26 additions & 4 deletions Tzkt.Api/Swagger/Swagger.cs
Original file line number Diff line number Diff line change
@@ -41,21 +41,32 @@ public static void AddOpenApiDocument(this IServiceCollection services)
Name = "TzKT Events",
Description = File.Exists("Swagger/WsGetStarted.md")
? File.ReadAllText("Swagger/WsGetStarted.md")
: null
: null,
ExtensionData = {{"tzkt-category", "ws"}}
});
document.Tags.Add(new NSwag.OpenApiTag
{
Name = "Subscriptions",
Description = File.Exists("Swagger/WsSubscriptions.md")
? File.ReadAllText("Swagger/WsSubscriptions.md")
: null
: null,
ExtensionData = {{"tzkt-category", "ws"}}
});
document.Tags.Add(new NSwag.OpenApiTag
{
Name = "Examples",
Description = File.Exists("Swagger/WsExamples.md")
? File.ReadAllText("Swagger/WsExamples.md")
: null
: null,
ExtensionData = {{"tzkt-category", "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"}}
});
document.ExtensionData = new Dictionary<string, object>
{
@@ -70,7 +81,18 @@ public static void AddOpenApiDocument(this IServiceCollection services)
new
{
name = "WebSocket API",
tags = document.Tags.Select(x => x.Name).ToList()
tags = document.Tags
.Where(x => x.ExtensionData["tzkt-category"].Equals("ws"))
.Select(x => x.Name)
.ToList()
},
new
{
name = "Libraries",
tags = document.Tags
.Where(x => x.ExtensionData["tzkt-category"].Equals("sdk"))
.Select(x => x.Name)
.ToList()
}
}
}
Loading

0 comments on commit 0bfe2dd

Please sign in to comment.