[csharp][generichost] Honor the Set-Cookie header (#17186)

* allow multiple auth methods of same type

* allow multiple auth methods of same type

* allow multiple headers to have api keys

* remove changes for another pr

* resolved conflicts, build samples

* fixed a casing issue

* fixed casing issue
This commit is contained in:
devhl-labs 2023-11-26 22:01:05 -05:00 committed by GitHub
parent 9fa3aec2e0
commit 4f82071502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
99 changed files with 1890 additions and 1440 deletions

View File

@ -444,7 +444,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
.put("copy", copyLambda)
.put("paste", new PasteLambda(copyLambda, true, true, true, false))
.put("pasteOnce", new PasteLambda(copyLambda, true, true, true, true))
.put("pasteLine", new PasteLambda(copyLambda, true, true, false, false));
.put("pasteLine", new PasteLambda(copyLambda, true, true, false, false))
.put("uniqueLines", new UniqueLambda("\n", false))
.put("unique", new UniqueLambda("\n", true));
}
@Override
@ -791,6 +793,11 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
response.vendorExtensions.put("x-is-reference-type", !isValueType);
}
if (response.headers != null && response.headers.stream().anyMatch(h -> h.baseName.equals("Set-Cookie"))) {
response.vendorExtensions.put("x-set-cookie", true);
operation.vendorExtensions.put("x-set-cookie", true);
}
String code = response.code.toLowerCase(Locale.ROOT);
switch(code) {
case "default":

View File

@ -51,7 +51,7 @@ public class UniqueLambda implements Mustache.Lambda {
@Override
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
String[] parts = fragment.execute().split(this.delimiter);
String[] parts = fragment.execute().split(this.delimiter, -1);
List<String> uniqueLines = Arrays.stream(parts).distinct().collect(Collectors.toList());

View File

@ -29,36 +29,36 @@ namespace {{packageName}}.Test.{{apiPackage}}
.Configure{{apiName}}((context, services, options) =>
{
{{#lambda.trimTrailingWithNewLine}}
{{#hasApiKeyMethods}}
string apiKeyTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
{{#apiKeyMethods}}
string apiKeyTokenValue{{-index}} = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, "{{name}}", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/hasApiKeyMethods}}
{{#hasHttpBearerMethods}}
string bearerTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(bearerTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
{{/apiKeyMethods}}
{{#httpBearerMethods}}
string bearerTokenValue{{-index}} = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(bearerTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken{{-index}});
{{/hasHttpBearerMethods}}
{{#hasHttpBasicMethods}}
string basicTokenUsername = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken = new{{^net70OrLater}} BasicToken{{/net70OrLater}}(basicTokenUsername, basicTokenPassword, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
{{/httpBearerMethods}}
{{#httpBasicMethods}}
string basicTokenUsername{{-index}} = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword{{-index}} = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}(basicTokenUsername{{-index}}, basicTokenPassword{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken{{-index}});
{{/hasHttpBasicMethods}}
{{#hasHttpSignatureMethods}}
HttpSigningConfiguration config = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
{{/httpBasicMethods}}
{{#httpSignatureMethods}}
HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken{{-index}});
{{/hasHttpSignatureMethods}}
{{#hasOAuthMethods}}
string oauthTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}(oauthTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
{{/hasOAuthMethods}}
{{/httpSignatureMethods}}
{{#oauthMethods}}
string oauthTokenValue{{-index}} = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}(oauthTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken{{-index}});
{{/oauthMethods}}
{{/lambda.trimTrailingWithNewLine}}
});
}

View File

@ -16,93 +16,145 @@ namespace {{packageName}}.Test.{{apiPackage}}
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).Configure{{apiName}}((context, services, options) =>
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty<string>(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) =>
{
{{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);{{/hasOAuthMethods}}
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}($"<token>", "{{name}}", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}
{{#httpBearerMethods}}
BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken{{-index}});
{{/httpBearerMethods}}
{{#httpBasicMethods}}
BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken{{-index}});
{{/httpBasicMethods}}
{{#httpSignatureMethods}}
HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("<keyId>", "<keyFilePath>", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List<string>(){{/net80OrLater}}, HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken{{-index}});
{{/httpSignatureMethods}}
{{#oauthMethods}}
OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken{{-index}});
{{/oauthMethods}}
{{/lambda.trimTrailingWithNewLine}}
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).Configure{{apiName}}((context, services, options) =>
Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty<string>(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) =>
{
{{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);{{/hasOAuthMethods}}
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}($"<token>", "{{name}}", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}
{{#httpBearerMethods}}
BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken{{-index}});
{{/httpBearerMethods}}
{{#httpBasicMethods}}
BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken{{-index}});
{{/httpBasicMethods}}
{{#httpSignatureMethods}}
HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("<keyId>", "<keyFilePath>", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List<string>(){{/net80OrLater}}, HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken{{-index}});
{{/httpSignatureMethods}}
{{#oauthMethods}}
OAuthToken oauthToken = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
{{/oauthMethods}}
{{/lambda.trimTrailingWithNewLine}}
options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty<string>(){{/net80OrLater}}).ConfigureServices((host, services) =>
{
services.Add{{apiName}}(options =>
{
{{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);{{/hasOAuthMethods}}
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}($"<token>", "{{name}}", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}
{{#httpBearerMethods}}
BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken{{-index}});
{{/httpBearerMethods}}
{{#httpBasicMethods}}
BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken{{-index}});
{{/httpBasicMethods}}
{{#httpSignatureMethods}}
HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("<keyId>", "<keyFilePath>", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List<string>(){{/net80OrLater}}, HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken{{-index}});
{{/httpSignatureMethods}}
{{#oauthMethods}}
OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken{{-index}});
{{/oauthMethods}}
{{/lambda.trimTrailingWithNewLine}}
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty<string>(){{/net80OrLater}}).ConfigureServices((host, services) =>
{
services.Add{{apiName}}(options =>
{
{{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);{{/hasOAuthMethods}}
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}($"<token>", "{{name}}", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}
{{#httpBearerMethods}}
BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken{{-index}});
{{/httpBearerMethods}}
{{#httpBasicMethods}}
BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken{{-index}});
{{/httpBasicMethods}}
{{#httpSignatureMethods}}
HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("<keyId>", "<keyFilePath>", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List<string>(){{/net80OrLater}}, HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken{{-index}});
{{/httpSignatureMethods}}
{{#oauthMethods}}
OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken{{-index}});
{{/oauthMethods}}
{{/lambda.trimTrailingWithNewLine}}
options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})
@ -116,7 +168,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{
{{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>();
Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}}
{{/-last}}{{/apis}}{{/apiInfo}}
}
@ -128,7 +180,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{
{{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>();
Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}}
{{/-last}}{{/apis}}{{/apiInfo}}
}
@ -152,7 +204,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{
{{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>();
Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}}
{{/-last}}{{/apis}}{{/apiInfo}}
}
}

View File

@ -7,6 +7,17 @@
{{/nrt}}
using System;
using System.Collections.Generic;
{{#net80OrLater}}
{{#lambda.uniqueLines}}
{{#operations}}
{{#operation}}
{{#vendorExtensions.x-set-cookie}}
using System.Linq;
{{/vendorExtensions.x-set-cookie}}
{{/operation}}
{{/operations}}
{{/lambda.uniqueLines}}
{{/net80OrLater}}
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
@ -183,6 +194,19 @@ namespace {{packageName}}.{{apiPackage}}
/// </summary>
public TokenProvider<OAuthToken> OauthTokenProvider { get; }{{/hasOAuthMethods}}
{{#net80OrLater}}
{{#lambda.unique}}
{{#operation}}
{{#vendorExtensions.x-set-cookie}}
/// <summary>
/// The token cookie container
/// </summary>
public {{packageName}}.{{clientPackage}}.CookieContainer CookieContainer { get; }
{{/vendorExtensions.x-set-cookie}}
{{/operation}}
{{/lambda.unique}}
{{/net80OrLater}}
/// <summary>
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
/// </summary>
@ -192,7 +216,8 @@ namespace {{packageName}}.{{apiPackage}}
TokenProvider<BearerToken> bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}},
TokenProvider<BasicToken> basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}},
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}},
TokenProvider<OAuthToken> oauthTokenProvider{{/hasOAuthMethods}})
TokenProvider<OAuthToken> oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}},
{{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}})
{
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
LoggerFactory = loggerFactory;
@ -203,7 +228,8 @@ namespace {{packageName}}.{{apiPackage}}
BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}
BasicTokenProvider = basicTokenProvider;{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}
HttpSignatureTokenProvider = httpSignatureTokenProvider;{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}
OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}}
OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}
CookieContainer = cookieContainer;{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}
}
{{#operation}}
@ -470,11 +496,14 @@ namespace {{packageName}}.{{apiPackage}}
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
{{/-first}}
{{#isApiKey}}
{{^isKeyInCookie}}
ApiKeyToken apiKeyTokenLocalVar{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar{{-index}});{{#isKeyInHeader}}
tokenBaseLocalVars.Add(apiKeyTokenLocalVar{{-index}});
{{#isKeyInHeader}}
apiKeyTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}");
{{/isKeyInHeader}}
{{/isKeyInCookie}}
{{#isKeyInQuery}}
apiKeyTokenLocalVar{{-index}}.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "{{keyParamName}}");
@ -593,6 +622,39 @@ namespace {{packageName}}.{{apiPackage}}
{{/-first}}
{{/authMethods}}
{{#net80OrLater}}
{{#responses}}
{{#vendorExtensions.x-set-cookie}}
if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) {{code}} && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar))
{
foreach(string cookieHeader in cookieHeadersLocalVar)
{
IList<Microsoft.Net.Http.Headers.SetCookieHeaderValue> setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray());
foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar)
{
Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString())
{
HttpOnly = setCookieHeaderValueLocalVar.HttpOnly
};
if (setCookieHeaderValueLocalVar.Expires.HasValue)
cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime;
if (setCookieHeaderValueLocalVar.Path.HasValue)
cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value;
if (setCookieHeaderValueLocalVar.Domain.HasValue)
cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value;
CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar);
}
}
}
{{/vendorExtensions.x-set-cookie}}
{{/responses}}
{{/net80OrLater}}
return apiResponseLocalVar;
}
}

View File

@ -40,6 +40,9 @@
{{#supportsRetry}}
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="{{#lambda.first}}{{#netStandard}}5.0.1 {{/netStandard}}{{#net47}}7.0.0 {{/net47}}{{#net48}}7.0.0 {{/net48}}{{#net6.0}}6.0.19 {{/net6.0}}{{#net7.0}}7.0.11 {{/net7.0}}{{#net8.0}}8.0.0 {{/net8.0}}{{/lambda.first}}" />
{{/supportsRetry}}
{{#net80OrLater}}
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
{{/net80OrLater}}
{{/useGenericHost}}
{{^useGenericHost}}
{{#supportsRetry}}

View File

@ -475,6 +475,13 @@ paths:
'200':
description: successful operation
headers:
Set-Cookie:
description: >-
Cookie authentication key for use with the `api_key`
apiKey authentication.
schema:
type: string
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
X-Rate-Limit:
description: calls per hour allowed by the user
schema:

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -52,26 +52,30 @@ namespace UseSourceGeneration.Test.Api
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
.ConfigureApi((context, services, options) =>
{
string apiKeyTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken = new(apiKeyTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
string apiKeyTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken1 = new(apiKeyTokenValue1, "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
string bearerTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken = new(bearerTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
string apiKeyTokenValue2 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken2 = new(apiKeyTokenValue2, "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
string basicTokenUsername = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken = new(basicTokenUsername, basicTokenPassword, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
string bearerTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken1 = new(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
HttpSigningConfiguration config = new("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
string basicTokenUsername1 = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword1 = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken1 = new(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
string oauthTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken = new(oauthTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
string oauthTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken1 = new(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
}
}

View File

@ -24,93 +24,105 @@ namespace UseSourceGeneration.Test.Api
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})
@ -124,22 +136,22 @@ namespace UseSourceGeneration.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -152,22 +164,22 @@ namespace UseSourceGeneration.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -208,22 +220,22 @@ namespace UseSourceGeneration.Test.Api
{
var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}

View File

@ -219,6 +219,16 @@ namespace UseSourceGeneration.Test.Api
await _instance.TestInlineAdditionalPropertiesAsync(requestBody);
}
/// <summary>
/// Test TestInlineFreeformAdditionalProperties
/// </summary>
[Fact (Skip = "not implemented")]
public async Task TestInlineFreeformAdditionalPropertiesAsyncTest()
{
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default!;
await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest);
}
/// <summary>
/// Test TestJsonFormData
/// </summary>

View File

@ -53,6 +53,15 @@ namespace UseSourceGeneration.Test.Model
//Assert.IsType<AdditionalPropertiesClass>(instance);
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
/// <summary>
/// Test the property 'EmptyMap'
/// </summary>
@ -115,14 +124,5 @@ namespace UseSourceGeneration.Test.Model
{
// TODO unit test for the property 'MapWithUndeclaredPropertiesString'
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
}
}

View File

@ -62,15 +62,6 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'MainShape'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
/// <summary>
/// Test the property 'NullableShape'
/// </summary>
@ -88,5 +79,14 @@ namespace UseSourceGeneration.Test.Model
{
// TODO unit test for the property 'ShapeOrNull'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
}
}

View File

@ -53,6 +53,15 @@ namespace UseSourceGeneration.Test.Model
//Assert.IsType<EnumTest>(instance);
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
{
// TODO unit test for the property 'EnumStringRequired'
}
/// <summary>
/// Test the property 'EnumInteger'
/// </summary>
@ -90,12 +99,12 @@ namespace UseSourceGeneration.Test.Model
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
public void OuterEnumTest()
{
// TODO unit test for the property 'EnumStringRequired'
// TODO unit test for the property 'OuterEnum'
}
/// <summary>
@ -124,14 +133,5 @@ namespace UseSourceGeneration.Test.Model
{
// TODO unit test for the property 'OuterEnumIntegerDefaultValue'
}
/// <summary>
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void OuterEnumTest()
{
// TODO unit test for the property 'OuterEnum'
}
}
}

View File

@ -53,15 +53,6 @@ namespace UseSourceGeneration.Test.Model
//Assert.IsType<FormatTest>(instance);
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'VarByte'
/// </summary>
@ -80,6 +71,33 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'Date'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'DateTime'
/// </summary>
@ -143,24 +161,6 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'Integer'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'PatternWithBackslash'
/// </summary>

View File

@ -53,24 +53,6 @@ namespace UseSourceGeneration.Test.Model
//Assert.IsType<NullableClass>(instance);
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ArrayAndItemsNullableProp'
/// </summary>
@ -80,6 +62,15 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'ArrayAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ArrayNullableProp'
/// </summary>
@ -143,6 +134,15 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'ObjectAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ObjectNullableProp'
/// </summary>

View File

@ -53,6 +53,15 @@ namespace UseSourceGeneration.Test.Model
//Assert.IsType<Order>(instance);
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
@ -97,14 +106,5 @@ namespace UseSourceGeneration.Test.Model
{
// TODO unit test for the property 'Status'
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
}
}

View File

@ -53,24 +53,6 @@ namespace UseSourceGeneration.Test.Model
//Assert.IsType<Pet>(instance);
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Name'
/// </summary>
@ -89,6 +71,24 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'PhotoUrls'
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Status'
/// </summary>

View File

@ -152,105 +152,6 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'RequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'RequiredNullableArrayOfString'
/// </summary>
@ -350,6 +251,24 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'RequiredNullableUuid'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNullableDateProp'
/// </summary>
@ -368,6 +287,87 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'NotRequiredNullableIntegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'NotrequiredNullableArrayOfString'
/// </summary>

View File

@ -53,6 +53,24 @@ namespace UseSourceGeneration.Test.Model
//Assert.IsType<User>(instance);
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'Email'
/// </summary>
@ -98,6 +116,15 @@ namespace UseSourceGeneration.Test.Model
// TODO unit test for the property 'ObjectWithNoDeclaredProps'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
@ -133,32 +160,5 @@ namespace UseSourceGeneration.Test.Model
{
// TODO unit test for the property 'Username'
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
}
}

View File

@ -282,6 +282,7 @@ namespace UseSourceGeneration.Api
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -1674,6 +1674,7 @@ namespace UseSourceGeneration.Api
ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar2);
apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -12,6 +12,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
@ -566,6 +567,11 @@ namespace UseSourceGeneration.Api
/// </summary>
public TokenProvider<OAuthToken> OauthTokenProvider { get; }
/// <summary>
/// The token cookie container
/// </summary>
public UseSourceGeneration.Client.CookieContainer CookieContainer { get; }
/// <summary>
/// Initializes a new instance of the <see cref="UserApi"/> class.
/// </summary>
@ -575,7 +581,8 @@ namespace UseSourceGeneration.Api
TokenProvider<BearerToken> bearerTokenProvider,
TokenProvider<BasicToken> basicTokenProvider,
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
TokenProvider<OAuthToken> oauthTokenProvider)
TokenProvider<OAuthToken> oauthTokenProvider,
UseSourceGeneration.Client.CookieContainer cookieContainer)
{
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
LoggerFactory = loggerFactory;
@ -587,6 +594,7 @@ namespace UseSourceGeneration.Api
BasicTokenProvider = basicTokenProvider;
HttpSignatureTokenProvider = httpSignatureTokenProvider;
OauthTokenProvider = oauthTokenProvider;
CookieContainer = cookieContainer;
}
partial void FormatCreateUser(User user);
@ -1716,6 +1724,33 @@ namespace UseSourceGeneration.Api
Events.ExecuteOnLoginUser(apiResponseLocalVar);
if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) 200 && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar))
{
foreach(string cookieHeader in cookieHeadersLocalVar)
{
IList<Microsoft.Net.Http.Headers.SetCookieHeaderValue> setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray());
foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar)
{
Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString())
{
HttpOnly = setCookieHeaderValueLocalVar.HttpOnly
};
if (setCookieHeaderValueLocalVar.Expires.HasValue)
cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime;
if (setCookieHeaderValueLocalVar.Path.HasValue)
cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value;
if (setCookieHeaderValueLocalVar.Domain.HasValue)
cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value;
CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar);
}
}
}
return apiResponseLocalVar;
}
}

View File

@ -25,6 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -52,26 +52,30 @@ namespace Org.OpenAPITools.Test.Api
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
.ConfigureApi((context, services, options) =>
{
string apiKeyTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken = new(apiKeyTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
string apiKeyTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken1 = new(apiKeyTokenValue1, "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
string bearerTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken = new(bearerTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
string apiKeyTokenValue2 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken2 = new(apiKeyTokenValue2, "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
string basicTokenUsername = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken = new(basicTokenUsername, basicTokenPassword, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
string bearerTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken1 = new(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
HttpSigningConfiguration config = new("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
string basicTokenUsername1 = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword1 = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken1 = new(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
string oauthTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken = new(oauthTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
string oauthTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken1 = new(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
}
}

View File

@ -24,93 +24,105 @@ namespace Org.OpenAPITools.Test.Api
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})
@ -124,22 +136,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -152,22 +164,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -208,22 +220,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}

View File

@ -219,6 +219,16 @@ namespace Org.OpenAPITools.Test.Api
await _instance.TestInlineAdditionalPropertiesAsync(requestBody);
}
/// <summary>
/// Test TestInlineFreeformAdditionalProperties
/// </summary>
[Fact (Skip = "not implemented")]
public async Task TestInlineFreeformAdditionalPropertiesAsyncTest()
{
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default!;
await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest);
}
/// <summary>
/// Test TestJsonFormData
/// </summary>

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<AdditionalPropertiesClass>(instance);
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
/// <summary>
/// Test the property 'EmptyMap'
/// </summary>
@ -115,14 +124,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'MapWithUndeclaredPropertiesString'
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
}
}

View File

@ -62,15 +62,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'MainShape'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
/// <summary>
/// Test the property 'NullableShape'
/// </summary>
@ -88,5 +79,14 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'ShapeOrNull'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
}
}

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<EnumTest>(instance);
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
{
// TODO unit test for the property 'EnumStringRequired'
}
/// <summary>
/// Test the property 'EnumInteger'
/// </summary>
@ -90,12 +99,12 @@ namespace Org.OpenAPITools.Test.Model
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
public void OuterEnumTest()
{
// TODO unit test for the property 'EnumStringRequired'
// TODO unit test for the property 'OuterEnum'
}
/// <summary>
@ -124,14 +133,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'OuterEnumIntegerDefaultValue'
}
/// <summary>
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void OuterEnumTest()
{
// TODO unit test for the property 'OuterEnum'
}
}
}

View File

@ -53,15 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<FormatTest>(instance);
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'VarByte'
/// </summary>
@ -80,6 +71,33 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'Date'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'DateTime'
/// </summary>
@ -143,24 +161,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'Integer'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'PatternWithBackslash'
/// </summary>

View File

@ -53,24 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<NullableClass>(instance);
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ArrayAndItemsNullableProp'
/// </summary>
@ -80,6 +62,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ArrayAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ArrayNullableProp'
/// </summary>
@ -143,6 +134,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ObjectAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ObjectNullableProp'
/// </summary>

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<Order>(instance);
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
@ -97,14 +106,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'Status'
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
}
}

View File

@ -53,24 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<Pet>(instance);
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Name'
/// </summary>
@ -89,6 +71,24 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'PhotoUrls'
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Status'
/// </summary>

View File

@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'RequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'RequiredNullableArrayOfString'
/// </summary>
@ -350,6 +251,24 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'RequiredNullableUuid'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNullableDateProp'
/// </summary>
@ -368,6 +287,87 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'NotRequiredNullableIntegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'NotrequiredNullableArrayOfString'
/// </summary>

View File

@ -53,6 +53,24 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<User>(instance);
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'Email'
/// </summary>
@ -98,6 +116,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ObjectWithNoDeclaredProps'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
@ -133,32 +160,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'Username'
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
}
}

View File

@ -282,6 +282,7 @@ namespace Org.OpenAPITools.Api
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -1674,6 +1674,7 @@ namespace Org.OpenAPITools.Api
ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar2);
apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -12,6 +12,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
@ -566,6 +567,11 @@ namespace Org.OpenAPITools.Api
/// </summary>
public TokenProvider<OAuthToken> OauthTokenProvider { get; }
/// <summary>
/// The token cookie container
/// </summary>
public Org.OpenAPITools.Client.CookieContainer CookieContainer { get; }
/// <summary>
/// Initializes a new instance of the <see cref="UserApi"/> class.
/// </summary>
@ -575,7 +581,8 @@ namespace Org.OpenAPITools.Api
TokenProvider<BearerToken> bearerTokenProvider,
TokenProvider<BasicToken> basicTokenProvider,
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
TokenProvider<OAuthToken> oauthTokenProvider)
TokenProvider<OAuthToken> oauthTokenProvider,
Org.OpenAPITools.Client.CookieContainer cookieContainer)
{
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
LoggerFactory = loggerFactory;
@ -587,6 +594,7 @@ namespace Org.OpenAPITools.Api
BasicTokenProvider = basicTokenProvider;
HttpSignatureTokenProvider = httpSignatureTokenProvider;
OauthTokenProvider = oauthTokenProvider;
CookieContainer = cookieContainer;
}
partial void FormatCreateUser(User user);
@ -1716,6 +1724,33 @@ namespace Org.OpenAPITools.Api
Events.ExecuteOnLoginUser(apiResponseLocalVar);
if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) 200 && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar))
{
foreach(string cookieHeader in cookieHeadersLocalVar)
{
IList<Microsoft.Net.Http.Headers.SetCookieHeaderValue> setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray());
foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar)
{
Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString())
{
HttpOnly = setCookieHeaderValueLocalVar.HttpOnly
};
if (setCookieHeaderValueLocalVar.Expires.HasValue)
cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime;
if (setCookieHeaderValueLocalVar.Path.HasValue)
cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value;
if (setCookieHeaderValueLocalVar.Domain.HasValue)
cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value;
CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar);
}
}
}
return apiResponseLocalVar;
}
}

View File

@ -25,6 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -52,26 +52,30 @@ namespace Org.OpenAPITools.Test.Api
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
.ConfigureApi((context, services, options) =>
{
string apiKeyTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken = new(apiKeyTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
string apiKeyTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken1 = new(apiKeyTokenValue1, "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
string bearerTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken = new(bearerTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
string apiKeyTokenValue2 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken2 = new(apiKeyTokenValue2, "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
string basicTokenUsername = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken = new(basicTokenUsername, basicTokenPassword, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
string bearerTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken1 = new(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
HttpSigningConfiguration config = new("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
string basicTokenUsername1 = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword1 = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken1 = new(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
string oauthTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken = new(oauthTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
string oauthTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken1 = new(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
}
}

View File

@ -24,93 +24,105 @@ namespace Org.OpenAPITools.Test.Api
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new("<keyId>", "<keyFilePath>", null, [], HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})
@ -124,22 +136,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -152,22 +164,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -208,22 +220,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}

View File

@ -219,6 +219,16 @@ namespace Org.OpenAPITools.Test.Api
await _instance.TestInlineAdditionalPropertiesAsync(requestBody);
}
/// <summary>
/// Test TestInlineFreeformAdditionalProperties
/// </summary>
[Fact (Skip = "not implemented")]
public async Task TestInlineFreeformAdditionalPropertiesAsyncTest()
{
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default;
await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest);
}
/// <summary>
/// Test TestJsonFormData
/// </summary>

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<AdditionalPropertiesClass>(instance);
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
/// <summary>
/// Test the property 'EmptyMap'
/// </summary>
@ -115,14 +124,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'MapWithUndeclaredPropertiesString'
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
}
}

View File

@ -62,15 +62,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'MainShape'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
/// <summary>
/// Test the property 'NullableShape'
/// </summary>
@ -88,5 +79,14 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'ShapeOrNull'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
}
}

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<EnumTest>(instance);
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
{
// TODO unit test for the property 'EnumStringRequired'
}
/// <summary>
/// Test the property 'EnumInteger'
/// </summary>
@ -90,12 +99,12 @@ namespace Org.OpenAPITools.Test.Model
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
public void OuterEnumTest()
{
// TODO unit test for the property 'EnumStringRequired'
// TODO unit test for the property 'OuterEnum'
}
/// <summary>
@ -124,14 +133,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'OuterEnumIntegerDefaultValue'
}
/// <summary>
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void OuterEnumTest()
{
// TODO unit test for the property 'OuterEnum'
}
}
}

View File

@ -53,15 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<FormatTest>(instance);
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'VarByte'
/// </summary>
@ -80,6 +71,33 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'Date'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'DateTime'
/// </summary>
@ -143,24 +161,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'Integer'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'PatternWithBackslash'
/// </summary>

View File

@ -53,24 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<NullableClass>(instance);
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ArrayAndItemsNullableProp'
/// </summary>
@ -80,6 +62,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ArrayAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ArrayNullableProp'
/// </summary>
@ -143,6 +134,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ObjectAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ObjectNullableProp'
/// </summary>

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<Order>(instance);
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
@ -97,14 +106,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'Status'
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
}
}

View File

@ -53,24 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<Pet>(instance);
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Name'
/// </summary>
@ -89,6 +71,24 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'PhotoUrls'
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Status'
/// </summary>

View File

@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'RequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'RequiredNullableArrayOfString'
/// </summary>
@ -350,6 +251,24 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'RequiredNullableUuid'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNullableDateProp'
/// </summary>
@ -368,6 +287,87 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'NotRequiredNullableIntegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'NotrequiredNullableArrayOfString'
/// </summary>

View File

@ -53,6 +53,24 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<User>(instance);
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'Email'
/// </summary>
@ -98,6 +116,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ObjectWithNoDeclaredProps'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
@ -133,32 +160,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'Username'
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
}
}

View File

@ -280,6 +280,7 @@ namespace Org.OpenAPITools.Api
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -1672,6 +1672,7 @@ namespace Org.OpenAPITools.Api
ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar2);
apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
@ -564,6 +565,11 @@ namespace Org.OpenAPITools.Api
/// </summary>
public TokenProvider<OAuthToken> OauthTokenProvider { get; }
/// <summary>
/// The token cookie container
/// </summary>
public Org.OpenAPITools.Client.CookieContainer CookieContainer { get; }
/// <summary>
/// Initializes a new instance of the <see cref="UserApi"/> class.
/// </summary>
@ -573,7 +579,8 @@ namespace Org.OpenAPITools.Api
TokenProvider<BearerToken> bearerTokenProvider,
TokenProvider<BasicToken> basicTokenProvider,
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
TokenProvider<OAuthToken> oauthTokenProvider)
TokenProvider<OAuthToken> oauthTokenProvider,
Org.OpenAPITools.Client.CookieContainer cookieContainer)
{
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
LoggerFactory = loggerFactory;
@ -585,6 +592,7 @@ namespace Org.OpenAPITools.Api
BasicTokenProvider = basicTokenProvider;
HttpSignatureTokenProvider = httpSignatureTokenProvider;
OauthTokenProvider = oauthTokenProvider;
CookieContainer = cookieContainer;
}
partial void FormatCreateUser(User user);
@ -1714,6 +1722,33 @@ namespace Org.OpenAPITools.Api
Events.ExecuteOnLoginUser(apiResponseLocalVar);
if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) 200 && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar))
{
foreach(string cookieHeader in cookieHeadersLocalVar)
{
IList<Microsoft.Net.Http.Headers.SetCookieHeaderValue> setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray());
foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar)
{
Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString())
{
HttpOnly = setCookieHeaderValueLocalVar.HttpOnly
};
if (setCookieHeaderValueLocalVar.Expires.HasValue)
cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime;
if (setCookieHeaderValueLocalVar.Path.HasValue)
cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value;
if (setCookieHeaderValueLocalVar.Domain.HasValue)
cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value;
CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar);
}
}
}
return apiResponseLocalVar;
}
}

View File

@ -24,6 +24,7 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -24,37 +24,37 @@ namespace Org.OpenAPITools.Test.Api
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})

View File

@ -25,6 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -24,37 +24,37 @@ namespace Org.OpenAPITools.Test.Api
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})

View File

@ -25,6 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -24,37 +24,37 @@ namespace Org.OpenAPITools.Test.Api
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
Host.CreateDefaultBuilder([]).ConfigureApi((context, services, options) =>
{
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
})
.Build();
private readonly IHost _hostUsingAddWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
});
})
.Build();
private readonly IHost _hostUsingAddWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureServices((host, services) =>
Host.CreateDefaultBuilder([]).ConfigureServices((host, services) =>
{
services.AddApi(options =>
{
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})

View File

@ -25,6 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -52,26 +52,30 @@ namespace Org.OpenAPITools.Test.Api
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args)
.ConfigureApi((context, services, options) =>
{
string apiKeyTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken = new ApiKeyToken(apiKeyTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
string apiKeyTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken1 = new ApiKeyToken(apiKeyTokenValue1, "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
string bearerTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken = new BearerToken(bearerTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
string apiKeyTokenValue2 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken2 = new ApiKeyToken(apiKeyTokenValue2, "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
string basicTokenUsername = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken = new BasicToken(basicTokenUsername, basicTokenPassword, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
string bearerTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
BearerToken bearerToken1 = new BearerToken(bearerTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
string basicTokenUsername1 = context.Configuration["<username>"] ?? throw new Exception("Username not found.");
string basicTokenPassword1 = context.Configuration["<password>"] ?? throw new Exception("Password not found.");
BasicToken basicToken1 = new BasicToken(basicTokenUsername1, basicTokenPassword1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
string oauthTokenValue = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken = new OAuthToken(oauthTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
HttpSigningConfiguration config1 = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
string oauthTokenValue1 = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
OAuthToken oauthToken1 = new OAuthToken(oauthTokenValue1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
}
}

View File

@ -24,43 +24,49 @@ namespace Org.OpenAPITools.Test.Api
/// </summary>
public class DependencyInjectionTest
{
private readonly IHost _hostUsingConfigureWithoutAClient =
private readonly IHost _hostUsingConfigureWithoutAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new ApiKeyToken($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new ApiKeyToken($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
})
.Build();
private readonly IHost _hostUsingConfigureWithAClient =
Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
ApiKeyToken apiKeyToken1 = new ApiKeyToken($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new ApiKeyToken($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
@ -72,21 +78,24 @@ namespace Org.OpenAPITools.Test.Api
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new ApiKeyToken($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new ApiKeyToken($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
});
})
.Build();
@ -96,21 +105,24 @@ namespace Org.OpenAPITools.Test.Api
{
services.AddApi(options =>
{
ApiKeyToken apiKeyToken = new ApiKeyToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
BearerToken bearerToken = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
BasicToken basicToken = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
ApiKeyToken apiKeyToken1 = new ApiKeyToken($"<token>", "api_key", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken1);
ApiKeyToken apiKeyToken2 = new ApiKeyToken($"<token>", "api_key_query", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken2);
BearerToken bearerToken1 = new BearerToken($"<token>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken1);
BasicToken basicToken1 = new BasicToken("<username>", "<password>", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken1);
HttpSigningConfiguration config1 = new HttpSigningConfiguration("<keyId>", "<keyFilePath>", null, new List<string>(), HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken1 = new HttpSignatureToken(config1, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken1);
OAuthToken oauthToken1 = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken1);
options.AddApiHttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS));
});
})
@ -124,22 +136,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -152,22 +164,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}
@ -208,22 +220,22 @@ namespace Org.OpenAPITools.Test.Api
{
var anotherFakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IAnotherFakeApi>();
Assert.True(anotherFakeApi.HttpClient.BaseAddress != null);
var defaultApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IDefaultApi>();
Assert.True(defaultApi.HttpClient.BaseAddress != null);
var fakeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeApi>();
Assert.True(fakeApi.HttpClient.BaseAddress != null);
var fakeClassnameTags123Api = _hostUsingAddWithoutAClient.Services.GetRequiredService<IFakeClassnameTags123Api>();
Assert.True(fakeClassnameTags123Api.HttpClient.BaseAddress != null);
var petApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IPetApi>();
Assert.True(petApi.HttpClient.BaseAddress != null);
var storeApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IStoreApi>();
Assert.True(storeApi.HttpClient.BaseAddress != null);
var userApi = _hostUsingAddWithoutAClient.Services.GetRequiredService<IUserApi>();
Assert.True(userApi.HttpClient.BaseAddress != null);
}

View File

@ -219,6 +219,16 @@ namespace Org.OpenAPITools.Test.Api
await _instance.TestInlineAdditionalPropertiesAsync(requestBody);
}
/// <summary>
/// Test TestInlineFreeformAdditionalProperties
/// </summary>
[Fact (Skip = "not implemented")]
public async Task TestInlineFreeformAdditionalPropertiesAsyncTest()
{
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = default;
await _instance.TestInlineFreeformAdditionalPropertiesAsync(testInlineFreeformAdditionalPropertiesRequest);
}
/// <summary>
/// Test TestJsonFormData
/// </summary>

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<AdditionalPropertiesClass>(instance);
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
/// <summary>
/// Test the property 'EmptyMap'
/// </summary>
@ -115,14 +124,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'MapWithUndeclaredPropertiesString'
}
/// <summary>
/// Test the property 'Anytype1'
/// </summary>
[Fact]
public void Anytype1Test()
{
// TODO unit test for the property 'Anytype1'
}
}
}

View File

@ -62,15 +62,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'MainShape'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
/// <summary>
/// Test the property 'NullableShape'
/// </summary>
@ -88,5 +79,14 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'ShapeOrNull'
}
/// <summary>
/// Test the property 'Shapes'
/// </summary>
[Fact]
public void ShapesTest()
{
// TODO unit test for the property 'Shapes'
}
}
}

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<EnumTest>(instance);
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
{
// TODO unit test for the property 'EnumStringRequired'
}
/// <summary>
/// Test the property 'EnumInteger'
/// </summary>
@ -90,12 +99,12 @@ namespace Org.OpenAPITools.Test.Model
}
/// <summary>
/// Test the property 'EnumStringRequired'
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void EnumStringRequiredTest()
public void OuterEnumTest()
{
// TODO unit test for the property 'EnumStringRequired'
// TODO unit test for the property 'OuterEnum'
}
/// <summary>
@ -124,14 +133,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'OuterEnumIntegerDefaultValue'
}
/// <summary>
/// Test the property 'OuterEnum'
/// </summary>
[Fact]
public void OuterEnumTest()
{
// TODO unit test for the property 'OuterEnum'
}
}
}

View File

@ -53,15 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<FormatTest>(instance);
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'VarByte'
/// </summary>
@ -80,6 +71,33 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'Date'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'Binary'
/// </summary>
[Fact]
public void BinaryTest()
{
// TODO unit test for the property 'Binary'
}
/// <summary>
/// Test the property 'DateTime'
/// </summary>
@ -143,24 +161,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'Integer'
}
/// <summary>
/// Test the property 'Number'
/// </summary>
[Fact]
public void NumberTest()
{
// TODO unit test for the property 'Number'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
[Fact]
public void PasswordTest()
{
// TODO unit test for the property 'Password'
}
/// <summary>
/// Test the property 'PatternWithBackslash'
/// </summary>

View File

@ -53,24 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<NullableClass>(instance);
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ArrayAndItemsNullableProp'
/// </summary>
@ -80,6 +62,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ArrayAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ArrayItemsNullable'
/// </summary>
[Fact]
public void ArrayItemsNullableTest()
{
// TODO unit test for the property 'ArrayItemsNullable'
}
/// <summary>
/// Test the property 'ArrayNullableProp'
/// </summary>
@ -143,6 +134,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ObjectAndItemsNullableProp'
}
/// <summary>
/// Test the property 'ObjectItemsNullable'
/// </summary>
[Fact]
public void ObjectItemsNullableTest()
{
// TODO unit test for the property 'ObjectItemsNullable'
}
/// <summary>
/// Test the property 'ObjectNullableProp'
/// </summary>

View File

@ -53,6 +53,15 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<Order>(instance);
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
@ -97,14 +106,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'Status'
}
/// <summary>
/// Test the property 'Complete'
/// </summary>
[Fact]
public void CompleteTest()
{
// TODO unit test for the property 'Complete'
}
}
}

View File

@ -53,24 +53,6 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<Pet>(instance);
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Name'
/// </summary>
@ -89,6 +71,24 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'PhotoUrls'
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Fact]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Fact]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Status'
/// </summary>

View File

@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'RequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'RequiredNullableArrayOfString'
/// </summary>
@ -350,6 +251,24 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'RequiredNullableUuid'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableDateProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableDatePropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableDateProp'
}
/// <summary>
/// Test the property 'NotRequiredNotnullableintegerProp'
/// </summary>
[Fact]
public void NotRequiredNotnullableintegerPropTest()
{
// TODO unit test for the property 'NotRequiredNotnullableintegerProp'
}
/// <summary>
/// Test the property 'NotRequiredNullableDateProp'
/// </summary>
@ -368,6 +287,87 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'NotRequiredNullableIntegerProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableArrayOfString'
/// </summary>
[Fact]
public void NotrequiredNotnullableArrayOfStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableArrayOfString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableBooleanProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableBooleanPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableBooleanProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableDatetimeProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableDatetimePropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableDatetimeProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumInteger'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumInteger'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumIntegerOnly'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumIntegerOnlyTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumIntegerOnly'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableEnumString'
/// </summary>
[Fact]
public void NotrequiredNotnullableEnumStringTest()
{
// TODO unit test for the property 'NotrequiredNotnullableEnumString'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableOuterEnumDefaultValue'
/// </summary>
[Fact]
public void NotrequiredNotnullableOuterEnumDefaultValueTest()
{
// TODO unit test for the property 'NotrequiredNotnullableOuterEnumDefaultValue'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableStringProp'
/// </summary>
[Fact]
public void NotrequiredNotnullableStringPropTest()
{
// TODO unit test for the property 'NotrequiredNotnullableStringProp'
}
/// <summary>
/// Test the property 'NotrequiredNotnullableUuid'
/// </summary>
[Fact]
public void NotrequiredNotnullableUuidTest()
{
// TODO unit test for the property 'NotrequiredNotnullableUuid'
}
/// <summary>
/// Test the property 'NotrequiredNullableArrayOfString'
/// </summary>

View File

@ -53,6 +53,24 @@ namespace Org.OpenAPITools.Test.Model
//Assert.IsType<User>(instance);
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'Email'
/// </summary>
@ -98,6 +116,15 @@ namespace Org.OpenAPITools.Test.Model
// TODO unit test for the property 'ObjectWithNoDeclaredProps'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
/// <summary>
/// Test the property 'Password'
/// </summary>
@ -133,32 +160,5 @@ namespace Org.OpenAPITools.Test.Model
{
// TODO unit test for the property 'Username'
}
/// <summary>
/// Test the property 'AnyTypeProp'
/// </summary>
[Fact]
public void AnyTypePropTest()
{
// TODO unit test for the property 'AnyTypeProp'
}
/// <summary>
/// Test the property 'AnyTypePropNullable'
/// </summary>
[Fact]
public void AnyTypePropNullableTest()
{
// TODO unit test for the property 'AnyTypePropNullable'
}
/// <summary>
/// Test the property 'ObjectWithNoDeclaredPropsNullable'
/// </summary>
[Fact]
public void ObjectWithNoDeclaredPropsNullableTest()
{
// TODO unit test for the property 'ObjectWithNoDeclaredPropsNullable'
}
}
}

View File

@ -279,6 +279,7 @@ namespace Org.OpenAPITools.Api
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -1668,6 +1668,7 @@ namespace Org.OpenAPITools.Api
ApiKeyToken apiKeyTokenLocalVar2 = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar2);
apiKeyTokenLocalVar2.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar, "api_key_query");
uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString();

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -560,7 +560,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -500,6 +500,14 @@ paths:
type: string
description: successful operation
headers:
Set-Cookie:
description: Cookie authentication key for use with the `api_key` apiKey
authentication.
explode: false
schema:
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
type: string
style: simple
X-Rate-Limit:
description: calls per hour allowed by the user
explode: false

View File

@ -536,7 +536,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)