Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSHARP] Default headers overwritten instead of duplicated | Body par… #20290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/generators/fsharp-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |OpenAPI/src|
|sourceFolder|source folder for generated code| |OpenAPI\src|

## IMPORT MAPPING

Expand Down
2 changes: 1 addition & 1 deletion docs/generators/fsharp-giraffe-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|packageVersion|F# package version.| |1.0.0|
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |OpenAPI/src|
|sourceFolder|source folder for generated code| |OpenAPI\src|
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |false|
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/java-inflector.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd></dl>|null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/gen/java|
|sourceFolder|source folder for generated code| |src\gen\java|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/jaxrs-cxf-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|snapshotVersion|Uses a SNAPSHOT version.|<dl><dt>**true**</dt><dd>Use a SnapShot Version</dd><dt>**false**</dt><dd>Use a Release Version</dd></dl>|null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/gen/java|
|sourceFolder|source folder for generated code| |src\gen\java|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk.| |false|
|useBeanValidation|Use BeanValidation API annotations| |false|
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/swift5.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result, Combine, AsyncAwait are available.| |null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|swiftPackagePath|Set a custom source path instead of OpenAPIClient/Classes/OpenAPIs.| |null|
|swiftPackagePath|Set a custom source path instead of OpenAPIClient\Classes\OpenAPIs.| |null|
|swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null|
|useBacktickEscapes|Escape reserved words using backticks (default: false)| |false|
|useClasses|Use final classes for models instead of structs (default: false)| |false|
|useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false|
|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: false).| |null|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources\{{projectName}} (default: false).| |null|
|validatable|Make validation rules and validator for model properies (default: true)| |true|

## IMPORT MAPPING
Expand Down
4 changes: 2 additions & 2 deletions docs/generators/swift6.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|responseAs|Optionally use libraries to manage response. Currently AsyncAwait, Combine, Result, RxSwift, ObjcBlock, PromiseKit are available.| |null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|swiftPackagePath|Set a custom source path instead of Sources/{{projectName}}.| |null|
|swiftPackagePath|Set a custom source path instead of Sources\{{projectName}}.| |null|
|swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null|
|useBacktickEscapes|Escape reserved words using backticks (default: false)| |false|
|useClasses|Use final classes for models instead of structs (default: false)| |false|
|useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false|
|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: true).| |null|
|useSPMFileStructure|Use SPM file structure and set the source path to Sources\{{projectName}} (default: true).| |null|
|validatable|Make validation rules and validator for model properies (default: true)| |true|

## IMPORT MAPPING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ namespace {{packageName}}.Client
{
foreach (var value in headerParam.Value)
{
request.AddHeader(headerParam.Key, value);
request.AddOrUpdateHeader(headerParam.Key, value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ namespace {{packageName}}.{{apiPackage}}
{{/required}}
{{/formParams}}
{{#bodyParam}}
localVarRequestOptions.Data = {{paramName}};
localVarRequestOptions.Data = {{packageName}}.Client.ClientUtils.Serialize({{paramName}});
{{/bodyParam}}

localVarRequestOptions.Operation = "{{classname}}.{{operationId}}";
Expand Down Expand Up @@ -693,7 +693,7 @@ namespace {{packageName}}.{{apiPackage}}
{{/required}}
{{/formParams}}
{{#bodyParam}}
localVarRequestOptions.Data = {{paramName}};
localVarRequestOptions.Data = {{packageName}}.Client.ClientUtils.Serialize({{paramName}});
{{/bodyParam}}

localVarRequestOptions.Operation = "{{classname}}.{{operationId}}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ public System.IO.Stream TestBinaryGif(int operationIndex = 0)
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = body;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(body);

localVarRequestOptions.Operation = "BodyApi.TestBodyApplicationOctetstreamBinary";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -871,7 +871,7 @@ public System.IO.Stream TestBinaryGif(int operationIndex = 0)
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = body;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(body);

localVarRequestOptions.Operation = "BodyApi.TestBodyApplicationOctetstreamBinary";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1229,7 +1229,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyAllOfPet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1297,7 +1297,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyAllOfPet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1363,7 +1363,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = body;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(body);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyFreeFormObjectResponseString";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1431,7 +1431,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = body;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(body);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyFreeFormObjectResponseString";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1497,7 +1497,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyPet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1565,7 +1565,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyPet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1631,7 +1631,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyPetResponseString";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1699,7 +1699,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyPetResponseString";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1765,7 +1765,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = body;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(body);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyStringEnum";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1833,7 +1833,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = body;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(body);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyStringEnum";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1899,7 +1899,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = tag;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(tag);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyTagResponseString";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1967,7 +1967,7 @@ public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArra
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = tag;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(tag);

localVarRequestOptions.Operation = "BodyApi.TestEchoBodyTagResponseString";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private RestRequest NewRequest(
{
foreach (var value in headerParam.Value)
{
request.AddHeader(headerParam.Key, value);
request.AddOrUpdateHeader(headerParam.Key, value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src/Api</directory>
<directory suffix=".php">./src/Model</directory>
<directory suffix=".php">./src\/Api</directory>
<directory suffix=".php">./src\/Model</directory>
</include>
</coverage>
<testsuites>
Expand Down
4 changes: 2 additions & 2 deletions samples/client/echo_api/php-nextgen/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src/Api</directory>
<directory suffix=".php">./src/Model</directory>
<directory suffix=".php">./src\/Api</directory>
<directory suffix=".php">./src\/Model</directory>
</include>
</coverage>
<testsuites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private RestRequest NewRequest(
{
foreach (var value in headerParam.Value)
{
request.AddHeader(headerParam.Key, value);
request.AddOrUpdateHeader(headerParam.Key, value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public Org.OpenAPITools.Client.ApiResponse<Pet> AddPetWithHttpInfo(Pet pet, int
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "PetApi.AddPet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -694,7 +694,7 @@ public Org.OpenAPITools.Client.ApiResponse<Pet> AddPetWithHttpInfo(Pet pet, int
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "PetApi.AddPet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1460,7 +1460,7 @@ public Org.OpenAPITools.Client.ApiResponse<Pet> UpdatePetWithHttpInfo(Pet pet, i
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "PetApi.UpdatePet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -1552,7 +1552,7 @@ public Org.OpenAPITools.Client.ApiResponse<Pet> UpdatePetWithHttpInfo(Pet pet, i
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = pet;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(pet);

localVarRequestOptions.Operation = "PetApi.UpdatePet";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ public Org.OpenAPITools.Client.ApiResponse<Order> PlaceOrderWithHttpInfo(Order o
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = order;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(order);

localVarRequestOptions.Operation = "StoreApi.PlaceOrder";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down Expand Up @@ -878,7 +878,7 @@ public Org.OpenAPITools.Client.ApiResponse<Order> PlaceOrderWithHttpInfo(Order o
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}

localVarRequestOptions.Data = order;
localVarRequestOptions.Data = Org.OpenAPITools.Client.ClientUtils.Serialize(order);

localVarRequestOptions.Operation = "StoreApi.PlaceOrder";
localVarRequestOptions.OperationIndex = operationIndex;
Expand Down
Loading
Loading