classname for generated openapi client

This commit is contained in:
ThatBen 2025-01-16 15:16:00 +01:00
parent 1a8b7b79ef
commit 064fc241cb
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
2 changed files with 7 additions and 10 deletions

View File

@ -1,4 +1,5 @@
using Logging;
using CodexOpenApi;
using Logging;
using Newtonsoft.Json;
using Utils;
using WebUtils;
@ -218,22 +219,22 @@ namespace CodexClient
processControl.DeleteDataDirFolder();
}
private T OnCodex<T>(Func<openapiClient, Task<T>> action)
private T OnCodex<T>(Func<CodexApiClient, Task<T>> action)
{
var result = httpFactory.CreateHttp(GetHttpId(), h => CheckContainerCrashed()).OnClient(client => CallCodex(client, action));
return result;
}
private T OnCodex<T>(Func<openapiClient, Task<T>> action, Retry retry)
private T OnCodex<T>(Func<CodexApiClient, Task<T>> action, Retry retry)
{
var result = httpFactory.CreateHttp(GetHttpId(), h => CheckContainerCrashed()).OnClient(client => CallCodex(client, action), retry);
return result;
}
private T CallCodex<T>(HttpClient client, Func<openapiClient, Task<T>> action)
private T CallCodex<T>(HttpClient client, Func<CodexApiClient, Task<T>> action)
{
var address = GetAddress();
var api = new openapiClient(client);
var api = new CodexApiClient(client);
api.BaseUrl = $"{address.Host}:{address.Port}/api/codex/v1";
return CrashCheck(() => Time.Wait(action(api)));
}

View File

@ -11,11 +11,7 @@
</ItemGroup>
<ItemGroup>
<OpenApiReference Include="openapi.yaml">
<CodeGenerator>NSwagCSharp</CodeGenerator>
<Namespace>CodexOpenApi</Namespace>
<ClassName></ClassName>
</OpenApiReference>
<OpenApiReference Include="openapi.yaml" CodeGenerator="NSwagCSharp" Namespace="CodexOpenApi" ClassName="CodexApiClient" />
</ItemGroup>
<ItemGroup>