mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 18:20:47 +01:00
22 lines
660 B
C#
22 lines
660 B
C#
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;
|
|
}
|
|
}
|