[csharp][generichost] Fix invalid key name (#19633)

* fix invalid key name

* fix comment
This commit is contained in:
devhl-labs 2024-09-29 11:09:37 -04:00 committed by GitHub
parent 0b32c5025e
commit fb5e69f83a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
93 changed files with 209 additions and 156 deletions

View File

@ -450,7 +450,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
.put("uniqueLines", new UniqueLambda("\n", false))
.put("unique", new UniqueLambda("\n", true))
.put("camel_case", new CamelCaseLambda())
.put("escape_reserved_word", new EscapeKeywordLambda(this::escapeKeyword));
.put("escape_reserved_word", new EscapeKeywordLambda(this::escapeKeyword))
.put("alphabet_or_underscore", new ReplaceAllLambda("[^A-Za-z]", "_"));
}
@Override

View File

@ -0,0 +1,52 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.templating.mustache;
import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;
import java.io.IOException;
import java.io.Writer;
/**
* Replaces all regex captures with the provided string.
*
* Register:
* <pre>
* additionalProperties.put("regex", new ReplaceAllLambda());
* </pre>
*
* Use:
* <pre>
* {{#regex}}{{summary}}{{/regex}}
* </pre>
*/
public class ReplaceAllLambda implements Mustache.Lambda {
private String regex;
private String replacement;
public ReplaceAllLambda(String regex, String replacement) {
this.regex = regex;
this.replacement = replacement;
}
@Override
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
writer.write(fragment.execute()
.replaceAll(regex, replacement));
}
}

View File

@ -31,7 +31,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
string apiKeyTokenValue{{-index}} = context.Configuration["<token>"] ?? throw new Exception("Token not found.");
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}

View File

@ -60,7 +60,7 @@ using System.Runtime.CompilerServices;
/// <summary>
/// The {{keyParamName}} header
/// </summary>
{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}{{^-last}},{{/-last}}
{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}{{^-last}},{{/-last}}
{{/apiKeyMethods}}
}
@ -76,7 +76,7 @@ using System.Runtime.CompilerServices;
return value switch
{
{{#apiKeyMethods}}
ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}} => "{{keyParamName}}",
ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}} => "{{keyParamName}}",
{{/apiKeyMethods}}
_ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)),
};
@ -85,7 +85,7 @@ using System.Runtime.CompilerServices;
switch(value)
{
{{#apiKeyMethods}}
case ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}:
case ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}:
return "{{keyParamName}}";
{{/apiKeyMethods}}
default:

View File

@ -21,7 +21,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}
@ -55,7 +55,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}
@ -92,7 +92,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}
@ -129,7 +129,7 @@ namespace {{packageName}}.Test.{{apiPackage}}
{
{{#lambda.trimTrailingWithNewLine}}
{{#apiKeyMethods}}
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("<token>", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{#lambda.alphabet_or_underscore}}{{keyParamName}}{{/lambda.alphabet_or_underscore}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken{{-index}});
{{/apiKeyMethods}}

View File

@ -1379,7 +1379,7 @@ components:
'read:pets': read your pets
api_key:
type: apiKey
name: api_key
name: api-key
in: header
api_key_query:
type: apiKey

View File

@ -3045,7 +3045,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1699,7 +1699,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -618,7 +618,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Client
switch(value)
{
case ApiKeyHeader.Api_key:
return "api_key";
return "api-key";
case ApiKeyHeader.Api_key_query:
return "api_key_query";
default:

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1699,7 +1699,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -618,7 +618,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Client
switch(value)
{
case ApiKeyHeader.Api_key:
return "api_key";
return "api-key";
case ApiKeyHeader.Api_key_query:
return "api_key_query";
default:

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3045,7 +3045,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1699,7 +1699,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -618,7 +618,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Client
switch(value)
{
case ApiKeyHeader.Api_key:
return "api_key";
return "api-key";
case ApiKeyHeader.Api_key_query:
return "api_key_query";
default:

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1699,7 +1699,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -618,7 +618,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Client
switch(value)
{
case ApiKeyHeader.Api_key:
return "api_key";
return "api-key";
case ApiKeyHeader.Api_key_query:
return "api_key_query";
default:

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3045,7 +3045,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1702,7 +1702,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -619,7 +619,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Client
{
return value switch
{
ApiKeyHeader.Api_key => "api_key",
ApiKeyHeader.Api_key => "api-key",
ApiKeyHeader.Api_key_query => "api_key_query",
_ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)),
};

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1704,7 +1704,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -621,7 +621,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -79,7 +79,7 @@ namespace Org.OpenAPITools.Client
{
return value switch
{
ApiKeyHeader.Api_key => "api_key",
ApiKeyHeader.Api_key => "api-key",
ApiKeyHeader.Api_key_query => "api_key_query",
_ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)),
};

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1702,7 +1702,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -619,7 +619,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Client
{
return value switch
{
ApiKeyHeader.Api_key => "api_key",
ApiKeyHeader.Api_key => "api-key",
ApiKeyHeader.Api_key_query => "api_key_query",
_ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)),
};

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1704,7 +1704,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -621,7 +621,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -79,7 +79,7 @@ namespace Org.OpenAPITools.Client
{
return value switch
{
ApiKeyHeader.Api_key => "api_key",
ApiKeyHeader.Api_key => "api-key",
ApiKeyHeader.Api_key_query => "api_key_query",
_ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)),
};

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1698,7 +1698,7 @@ namespace Org.OpenAPITools.Api
System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty);
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -617,7 +617,7 @@ namespace Org.OpenAPITools.Api
uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/store/inventory";
List<TokenBase> tokenBaseLocalVars = new List<TokenBase>();
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api_key", cancellationToken).ConfigureAwait(false);
ApiKeyToken apiKeyTokenLocalVar1 = (ApiKeyToken) await ApiKeyProvider.GetAsync("api-key", cancellationToken).ConfigureAwait(false);
tokenBaseLocalVars.Add(apiKeyTokenLocalVar1);
apiKeyTokenLocalVar1.UseInHeader(httpRequestMessageLocalVar);

View File

@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Client
public enum ApiKeyHeader
{
/// <summary>
/// The api_key header
/// The api-key header
/// </summary>
Api_key,
/// <summary>
@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Client
switch(value)
{
case ApiKeyHeader.Api_key:
return "api_key";
return "api-key";
case ApiKeyHeader.Api_key_query:
return "api_key_query";
default:

View File

@ -134,7 +134,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -299,7 +299,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -426,9 +426,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -127,9 +127,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();

View File

@ -1311,9 +1311,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
@ -1377,9 +1377,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))

View File

@ -565,9 +565,9 @@ namespace Org.OpenAPITools.Api
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request
@ -622,9 +622,9 @@ namespace Org.OpenAPITools.Api
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request

View File

@ -286,7 +286,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1457,9 +1457,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
@ -1535,9 +1535,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))

View File

@ -528,9 +528,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request
@ -597,9 +597,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request

View File

@ -274,7 +274,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1457,9 +1457,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
@ -1535,9 +1535,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))

View File

@ -528,9 +528,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request
@ -597,9 +597,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.OperationIndex = operationIndex;
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request

View File

@ -260,7 +260,7 @@ Authentication schemes defined for the API:
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **API key parameter name**: api-key
- **Location**: HTTP header
<a id="api_key_query"></a>

View File

@ -3069,7 +3069,7 @@ components:
type: oauth2
api_key:
in: header
name: api_key
name: api-key
type: apiKey
api_key_query:
in: query

View File

@ -409,9 +409,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

View File

@ -122,9 +122,9 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api-key", "Bearer");
var apiInstance = new StoreApi(config);

View File

@ -1285,9 +1285,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
@ -1356,9 +1356,9 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// authentication (api_key_query) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))

View File

@ -506,9 +506,9 @@ namespace Org.OpenAPITools.Api
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request
@ -568,9 +568,9 @@ namespace Org.OpenAPITools.Api
// authentication (api_key) required
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api-key")))
{
localVarRequestOptions.HeaderParameters.Add("api_key", this.Configuration.GetApiKeyWithPrefix("api_key"));
localVarRequestOptions.HeaderParameters.Add("api-key", this.Configuration.GetApiKeyWithPrefix("api-key"));
}
// make the HTTP request