mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 18:20:47 +01:00
WIP
This commit is contained in:
21
Needlework.Net.Core/Resources.cs
Normal file
21
Needlework.Net.Core/Resources.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Microsoft.OpenApi.Readers;
|
||||
|
||||
namespace Needlework.Net.Core;
|
||||
|
||||
public static class Resources
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the OpenApi document of the LCU schema. Provided by dysolix.
|
||||
/// </summary>
|
||||
/// <param name="httpClient"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<OpenApiDocument> GetOpenApiDocumentAsync(HttpClient httpClient)
|
||||
{
|
||||
var stream = await httpClient.GetStreamAsync("https://raw.githubusercontent.com/dysolix/hasagi-types/main/swagger.json");
|
||||
|
||||
var document = new OpenApiStreamReader().Read(stream, out var _);
|
||||
|
||||
return document;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user