diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md
index 8e6cd6abb7d6..da8868f93841 100644
--- a/docs/generators/csharp.md
+++ b/docs/generators/csharp.md
@@ -31,11 +31,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|library|HTTP library template (sub-template) to use|
- **generichost**
- HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) (Experimental. Subject to breaking changes without notice.)
- **httpclient**
- HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. Subject to breaking changes without notice.)
- **unityWebRequest**
- UnityWebRequest (...) (Experimental. Subject to breaking changes without notice.)
- **restsharp**
- RestSharp (https://github.com/restsharp/RestSharp)
|restsharp|
|licenseId|The identifier of the license| |null|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase|
-|modelPropertySorting|One of legacy, alphabetical, default (only `generichost` library supports this option).| |legacy|
+|modelPropertySorting|One of legacy, alphabetical, default.| |default|
|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false|
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false|
|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer. Starting in .NET 6.0 the default is true.| |false|
-|operationParameterSorting|One of legacy, alphabetical, default (only `generichost` library supports this option).| |legacy|
+|operationParameterSorting|One of legacy, alphabetical, default.| |default|
|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true|
|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false|
|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
index 901696e19180..186249054c94 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
@@ -3092,16 +3092,7 @@ public CodegenModel fromModel(String name, Schema schema) {
}
if (sortModelPropertiesByRequiredFlag) {
- Comparator comparator = new Comparator() {
- @Override
- public int compare(CodegenProperty one, CodegenProperty another) {
- if (one.required == another.required) return 0;
- else if (one.required) return -1;
- else return 1;
- }
- };
- Collections.sort(m.vars, comparator);
- Collections.sort(m.allVars, comparator);
+ SortModelPropertiesByRequiredFlag(m);
}
// post process model properties
@@ -3120,6 +3111,19 @@ public int compare(CodegenProperty one, CodegenProperty another) {
return m;
}
+ protected void SortModelPropertiesByRequiredFlag(CodegenModel model) {
+ Comparator comparator = new Comparator() {
+ @Override
+ public int compare(CodegenProperty one, CodegenProperty another) {
+ if (one.required == another.required) return 0;
+ else if (one.required) return -1;
+ else return 1;
+ }
+ };
+ Collections.sort(model.vars, comparator);
+ Collections.sort(model.allVars, comparator);
+ }
+
protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property) {
if (schema.equals(new Schema())) {
// if we are trying to set additionalProperties on an empty schema stop recursing
@@ -4729,17 +4733,7 @@ public CodegenOperation fromOperation(String path,
// move "required" parameters in front of "optional" parameters
if (sortParamsByRequiredFlag) {
- Collections.sort(allParams, new Comparator() {
- @Override
- public int compare(CodegenParameter one, CodegenParameter another) {
- if (one.required == another.required)
- return 0;
- else if (one.required)
- return -1;
- else
- return 1;
- }
- });
+ SortParametersByRequiredFlag(allParams);
}
op.allParams = allParams;
@@ -4773,6 +4767,20 @@ else if (one.required)
return op;
}
+ public void SortParametersByRequiredFlag(List parameters) {
+ Collections.sort(parameters, new Comparator() {
+ @Override
+ public int compare(CodegenParameter one, CodegenParameter another) {
+ if (one.required == another.required)
+ return 0;
+ else if (one.required)
+ return -1;
+ else
+ return 1;
+ }
+ });
+ }
+
public boolean isParameterNameUnique(CodegenParameter p, List parameters) {
for (CodegenParameter parameter : parameters) {
if (System.identityHashCode(p) == System.identityHashCode(parameter)) {
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java
index fd12c4fffbbc..15ff7fd96f7a 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java
@@ -468,12 +468,8 @@ public CodegenModel fromModel(String name, Schema model) {
}
}
- // TODO: remove the library check by adding alphabetical and default options for other libraries
-
- // avoid breaking changes
- if (GENERICHOST.equals(getLibrary()) && codegenModel != null) {
-
- if (this.modelPropertySorting == SortingMethod.LEGACY) {
+ if (codegenModel != null) {
+ if (this.modelPropertySorting == SortingMethod.ALPHABETICAL) {
Collections.sort(codegenModel.vars, propertyComparatorByName);
Collections.sort(codegenModel.allVars, propertyComparatorByName);
Collections.sort(codegenModel.requiredVars, propertyComparatorByName);
@@ -481,17 +477,11 @@ public CodegenModel fromModel(String name, Schema model) {
Collections.sort(codegenModel.readOnlyVars, propertyComparatorByName);
Collections.sort(codegenModel.readWriteVars, propertyComparatorByName);
Collections.sort(codegenModel.parentVars, propertyComparatorByName);
-
- Collections.sort(codegenModel.vars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
- Collections.sort(codegenModel.allVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
- Collections.sort(codegenModel.requiredVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
- Collections.sort(codegenModel.optionalVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
- Collections.sort(codegenModel.readOnlyVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
- Collections.sort(codegenModel.readWriteVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
- Collections.sort(codegenModel.parentVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
}
- else {
- if (this.modelPropertySorting == SortingMethod.ALPHABETICAL) {
+
+ if (GENERICHOST.equals(getLibrary())) {
+
+ if (this.modelPropertySorting == SortingMethod.LEGACY) {
Collections.sort(codegenModel.vars, propertyComparatorByName);
Collections.sort(codegenModel.allVars, propertyComparatorByName);
Collections.sort(codegenModel.requiredVars, propertyComparatorByName);
@@ -499,16 +489,27 @@ public CodegenModel fromModel(String name, Schema model) {
Collections.sort(codegenModel.readOnlyVars, propertyComparatorByName);
Collections.sort(codegenModel.readWriteVars, propertyComparatorByName);
Collections.sort(codegenModel.parentVars, propertyComparatorByName);
- }
- Collections.sort(codegenModel.vars, propertyComparatorByNotNullableRequiredNoDefault);
- Collections.sort(codegenModel.allVars, propertyComparatorByNotNullableRequiredNoDefault);
- Collections.sort(codegenModel.requiredVars, propertyComparatorByNotNullableRequiredNoDefault);
- Collections.sort(codegenModel.optionalVars, propertyComparatorByNotNullableRequiredNoDefault);
- Collections.sort(codegenModel.readOnlyVars, propertyComparatorByNotNullableRequiredNoDefault);
- Collections.sort(codegenModel.readWriteVars, propertyComparatorByNotNullableRequiredNoDefault);
- Collections.sort(codegenModel.parentVars, propertyComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(codegenModel.vars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
+ Collections.sort(codegenModel.allVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
+ Collections.sort(codegenModel.requiredVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
+ Collections.sort(codegenModel.optionalVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
+ Collections.sort(codegenModel.readOnlyVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
+ Collections.sort(codegenModel.readWriteVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
+ Collections.sort(codegenModel.parentVars, propertyComparatorByNotNullableRequiredNoDefaultLegacy);
+ }
+ else {
+ Collections.sort(codegenModel.vars, propertyComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(codegenModel.allVars, propertyComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(codegenModel.requiredVars, propertyComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(codegenModel.optionalVars, propertyComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(codegenModel.readOnlyVars, propertyComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(codegenModel.readWriteVars, propertyComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(codegenModel.parentVars, propertyComparatorByNotNullableRequiredNoDefault);
+ }
}
+ } else {
+ SortModelPropertiesByRequiredFlag(codegenModel);
}
return codegenModel;
@@ -928,63 +929,61 @@ public CodegenOperation fromOperation(String path,
List servers) {
CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers);
- // TODO: remove the library check by adding alphabetical and default options for other libraries
+ if (this.operationParameterSorting == SortingMethod.ALPHABETICAL) {
+ Collections.sort(op.allParams, parameterComparatorByName);
+ Collections.sort(op.bodyParams, parameterComparatorByName);
+ Collections.sort(op.pathParams, parameterComparatorByName);
+ Collections.sort(op.queryParams, parameterComparatorByName);
+ Collections.sort(op.headerParams, parameterComparatorByName);
+ Collections.sort(op.implicitHeadersParams, parameterComparatorByName);
+ Collections.sort(op.formParams, parameterComparatorByName);
+ Collections.sort(op.cookieParams, parameterComparatorByName);
+ Collections.sort(op.requiredParams, parameterComparatorByName);
+ Collections.sort(op.optionalParams, parameterComparatorByName);
+ Collections.sort(op.notNullableParams, parameterComparatorByName);
+ }
- if (!GENERICHOST.equals(getLibrary())) {
- return op;
- }
-
- if (this.operationParameterSorting == SortingMethod.LEGACY) {
- Collections.sort(op.allParams, parameterComparatorByDataType);
- Collections.sort(op.bodyParams, parameterComparatorByDataType);
- Collections.sort(op.pathParams, parameterComparatorByDataType);
- Collections.sort(op.queryParams, parameterComparatorByDataType);
- Collections.sort(op.headerParams, parameterComparatorByDataType);
- Collections.sort(op.implicitHeadersParams, parameterComparatorByDataType);
- Collections.sort(op.formParams, parameterComparatorByDataType);
- Collections.sort(op.cookieParams, parameterComparatorByDataType);
- Collections.sort(op.requiredParams, parameterComparatorByDataType);
- Collections.sort(op.optionalParams, parameterComparatorByDataType);
- Collections.sort(op.notNullableParams, parameterComparatorByDataType);
-
- Comparator comparator = parameterComparatorByRequired.thenComparing(parameterComparatorByDefaultValue);
- Collections.sort(op.allParams, comparator);
- Collections.sort(op.bodyParams, comparator);
- Collections.sort(op.pathParams, comparator);
- Collections.sort(op.queryParams, comparator);
- Collections.sort(op.headerParams, comparator);
- Collections.sort(op.implicitHeadersParams, comparator);
- Collections.sort(op.formParams, comparator);
- Collections.sort(op.cookieParams, comparator);
- Collections.sort(op.requiredParams, comparator);
- Collections.sort(op.optionalParams, comparator);
- Collections.sort(op.notNullableParams, comparator);
- } else {
- if (this.operationParameterSorting == SortingMethod.ALPHABETICAL) {
- Collections.sort(op.allParams, parameterComparatorByName);
- Collections.sort(op.bodyParams, parameterComparatorByName);
- Collections.sort(op.pathParams, parameterComparatorByName);
- Collections.sort(op.queryParams, parameterComparatorByName);
- Collections.sort(op.headerParams, parameterComparatorByName);
- Collections.sort(op.implicitHeadersParams, parameterComparatorByName);
- Collections.sort(op.formParams, parameterComparatorByName);
- Collections.sort(op.cookieParams, parameterComparatorByName);
- Collections.sort(op.requiredParams, parameterComparatorByName);
- Collections.sort(op.optionalParams, parameterComparatorByName);
- Collections.sort(op.notNullableParams, parameterComparatorByName);
+ if (GENERICHOST.equals(getLibrary())) {
+ if (this.operationParameterSorting == SortingMethod.LEGACY) {
+ Collections.sort(op.allParams, parameterComparatorByDataType);
+ Collections.sort(op.bodyParams, parameterComparatorByDataType);
+ Collections.sort(op.pathParams, parameterComparatorByDataType);
+ Collections.sort(op.queryParams, parameterComparatorByDataType);
+ Collections.sort(op.headerParams, parameterComparatorByDataType);
+ Collections.sort(op.implicitHeadersParams, parameterComparatorByDataType);
+ Collections.sort(op.formParams, parameterComparatorByDataType);
+ Collections.sort(op.cookieParams, parameterComparatorByDataType);
+ Collections.sort(op.requiredParams, parameterComparatorByDataType);
+ Collections.sort(op.optionalParams, parameterComparatorByDataType);
+ Collections.sort(op.notNullableParams, parameterComparatorByDataType);
+
+ Comparator comparator = parameterComparatorByRequired.thenComparing(parameterComparatorByDefaultValue);
+ Collections.sort(op.allParams, comparator);
+ Collections.sort(op.bodyParams, comparator);
+ Collections.sort(op.pathParams, comparator);
+ Collections.sort(op.queryParams, comparator);
+ Collections.sort(op.headerParams, comparator);
+ Collections.sort(op.implicitHeadersParams, comparator);
+ Collections.sort(op.formParams, comparator);
+ Collections.sort(op.cookieParams, comparator);
+ Collections.sort(op.requiredParams, comparator);
+ Collections.sort(op.optionalParams, comparator);
+ Collections.sort(op.notNullableParams, comparator);
+ } else {
+ Collections.sort(op.allParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.bodyParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.pathParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.queryParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.headerParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.implicitHeadersParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.formParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.cookieParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.requiredParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.optionalParams, parameterComparatorByNotNullableRequiredNoDefault);
+ Collections.sort(op.notNullableParams, parameterComparatorByNotNullableRequiredNoDefault);
}
-
- Collections.sort(op.allParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.bodyParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.pathParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.queryParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.headerParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.implicitHeadersParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.formParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.cookieParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.requiredParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.optionalParams, parameterComparatorByNotNullableRequiredNoDefault);
- Collections.sort(op.notNullableParams, parameterComparatorByNotNullableRequiredNoDefault);
+ } else {
+ SortParametersByRequiredFlag(op.allParams);
}
return op;
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Adult.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Adult.md
index 4bf74e4efc9b..61a97ca2192b 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Adult.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Adult.md
@@ -5,9 +5,9 @@ A representation of an adult
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**FirstName** | **string** | | [optional]
-**LastName** | **string** | | [optional]
**Type** | **string** | | [optional]
+**LastName** | **string** | | [optional]
+**FirstName** | **string** | | [optional]
**Children** | [**List<Child>**](Child.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md
index bb2a1e5a5613..9ac30fd2d619 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md
@@ -5,11 +5,11 @@ A representation of a child
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**FirstName** | **string** | | [optional]
-**LastName** | **string** | | [optional]
**Type** | **string** | | [optional]
-**Age** | **int** | | [optional]
+**LastName** | **string** | | [optional]
+**FirstName** | **string** | | [optional]
**BoosterSeat** | **bool** | | [optional]
+**Age** | **int** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Person.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Person.md
index 42c19689f9a1..b41b51f12f2a 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Person.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Person.md
@@ -4,9 +4,9 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**FirstName** | **string** | | [optional]
-**LastName** | **string** | | [optional]
**Type** | **string** | | [optional]
+**LastName** | **string** | | [optional]
+**FirstName** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs
index 7806add08bde..d03f2d88895c 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs
@@ -32,11 +32,11 @@ public partial class Adult : Person, IValidatableObject
///
/// Initializes a new instance of the class.
///
- /// children
- /// firstName
/// lastName
+ /// firstName
+ /// children
[JsonConstructor]
- public Adult(Option> children = default, Option firstName = default, Option lastName = default) : base(firstName, lastName)
+ public Adult(Option lastName = default, Option firstName = default, Option> children = default) : base(lastName, firstName)
{
ChildrenOption = children;
OnCreated();
@@ -44,6 +44,13 @@ public Adult(Option> children = default, Option firstName =
partial void OnCreated();
+ ///
+ /// The discriminator
+ ///
+ [JsonIgnore]
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public new string Type { get; } = "Adult";
+
///
/// Used to track the state of Children
///
@@ -57,13 +64,6 @@ public Adult(Option> children = default, Option firstName =
[JsonPropertyName("children")]
public List Children { get { return this.ChildrenOption; } set { this.ChildrenOption = new Option>(value); } }
- ///
- /// The discriminator
- ///
- [JsonIgnore]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public new string Type { get; } = "Adult";
-
///
/// Returns the string presentation of the object
///
@@ -101,10 +101,10 @@ public override Adult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
- Option> children = default;
- Option firstName = default;
- Option lastName = default;
Option type = default;
+ Option lastName = default;
+ Option firstName = default;
+ Option> children = default;
while (utf8JsonReader.Read())
{
@@ -121,18 +121,18 @@ public override Adult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
switch (localVarJsonPropertyName)
{
- case "children":
- if (utf8JsonReader.TokenType != JsonTokenType.Null)
- children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions));
- break;
- case "firstName":
- firstName = new Option(utf8JsonReader.GetString());
+ case "$_type":
+ type = new Option(utf8JsonReader.GetString());
break;
case "lastName":
lastName = new Option(utf8JsonReader.GetString());
break;
- case "$_type":
- type = new Option(utf8JsonReader.GetString());
+ case "firstName":
+ firstName = new Option(utf8JsonReader.GetString());
+ break;
+ case "children":
+ if (utf8JsonReader.TokenType != JsonTokenType.Null)
+ children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions));
break;
default:
break;
@@ -140,19 +140,19 @@ public override Adult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
}
}
- if (children.IsSet && children.Value == null)
- throw new ArgumentNullException(nameof(children), "Property is not nullable for class Adult.");
-
- if (firstName.IsSet && firstName.Value == null)
- throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Adult.");
+ if (type.IsSet && type.Value == null)
+ throw new ArgumentNullException(nameof(type), "Property is not nullable for class Adult.");
if (lastName.IsSet && lastName.Value == null)
throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Adult.");
- if (type.IsSet && type.Value == null)
- throw new ArgumentNullException(nameof(type), "Property is not nullable for class Adult.");
+ if (firstName.IsSet && firstName.Value == null)
+ throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Adult.");
+
+ if (children.IsSet && children.Value == null)
+ throw new ArgumentNullException(nameof(children), "Property is not nullable for class Adult.");
- return new Adult(children, firstName, lastName);
+ return new Adult(lastName, firstName, children);
}
///
@@ -179,27 +179,28 @@ public override void Write(Utf8JsonWriter writer, Adult adult, JsonSerializerOpt
///
public void WriteProperties(Utf8JsonWriter writer, Adult adult, JsonSerializerOptions jsonSerializerOptions)
{
- if (adult.ChildrenOption.IsSet && adult.Children == null)
- throw new ArgumentNullException(nameof(adult.Children), "Property is required for class Adult.");
+ if (adult.LastNameOption.IsSet && adult.LastName == null)
+ throw new ArgumentNullException(nameof(adult.LastName), "Property is required for class Adult.");
if (adult.FirstNameOption.IsSet && adult.FirstName == null)
throw new ArgumentNullException(nameof(adult.FirstName), "Property is required for class Adult.");
- if (adult.LastNameOption.IsSet && adult.LastName == null)
- throw new ArgumentNullException(nameof(adult.LastName), "Property is required for class Adult.");
+ if (adult.ChildrenOption.IsSet && adult.Children == null)
+ throw new ArgumentNullException(nameof(adult.Children), "Property is required for class Adult.");
+
+ writer.WriteString("$_type", adult.Type);
+
+ if (adult.LastNameOption.IsSet)
+ writer.WriteString("lastName", adult.LastName);
+
+ if (adult.FirstNameOption.IsSet)
+ writer.WriteString("firstName", adult.FirstName);
if (adult.ChildrenOption.IsSet)
{
writer.WritePropertyName("children");
JsonSerializer.Serialize(writer, adult.Children, jsonSerializerOptions);
}
- if (adult.FirstNameOption.IsSet)
- writer.WriteString("firstName", adult.FirstName);
-
- if (adult.LastNameOption.IsSet)
- writer.WriteString("lastName", adult.LastName);
-
- writer.WriteString("$_type", adult.Type);
}
}
}
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs
index 35adb6d48805..6d3836752c61 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs
@@ -32,12 +32,12 @@ public partial class Child : Person, IValidatableObject
///
/// Initializes a new instance of the class.
///
- /// age
- /// firstName
/// lastName
+ /// firstName
+ /// age
/// boosterSeat
[JsonConstructor]
- public Child(Option age = default, Option firstName = default, Option lastName = default, Option boosterSeat = default) : base(firstName, lastName)
+ public Child(Option lastName = default, Option firstName = default, Option age = default, Option boosterSeat = default) : base(lastName, firstName)
{
AgeOption = age;
BoosterSeatOption = boosterSeat;
@@ -46,6 +46,13 @@ public Child(Option age = default, Option firstName = default, Opt
partial void OnCreated();
+ ///
+ /// The discriminator
+ ///
+ [JsonIgnore]
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public new string Type { get; } = "Child";
+
///
/// Used to track the state of Age
///
@@ -59,13 +66,6 @@ public Child(Option age = default, Option firstName = default, Opt
[JsonPropertyName("age")]
public int? Age { get { return this.AgeOption; } set { this.AgeOption = new Option(value); } }
- ///
- /// The discriminator
- ///
- [JsonIgnore]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public new string Type { get; } = "Child";
-
///
/// Used to track the state of BoosterSeat
///
@@ -88,8 +88,8 @@ public override string ToString()
StringBuilder sb = new StringBuilder();
sb.Append("class Child {\n");
sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n");
- sb.Append(" Age: ").Append(Age).Append("\n");
sb.Append(" BoosterSeat: ").Append(BoosterSeat).Append("\n");
+ sb.Append(" Age: ").Append(Age).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@@ -117,10 +117,10 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
- Option age = default;
- Option firstName = default;
- Option lastName = default;
Option type = default;
+ Option lastName = default;
+ Option firstName = default;
+ Option age = default;
Option boosterSeat = default;
while (utf8JsonReader.Read())
@@ -138,18 +138,18 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
switch (localVarJsonPropertyName)
{
- case "age":
- if (utf8JsonReader.TokenType != JsonTokenType.Null)
- age = new Option(utf8JsonReader.GetInt32());
- break;
- case "firstName":
- firstName = new Option(utf8JsonReader.GetString());
+ case "$_type":
+ type = new Option(utf8JsonReader.GetString());
break;
case "lastName":
lastName = new Option(utf8JsonReader.GetString());
break;
- case "$_type":
- type = new Option(utf8JsonReader.GetString());
+ case "firstName":
+ firstName = new Option(utf8JsonReader.GetString());
+ break;
+ case "age":
+ if (utf8JsonReader.TokenType != JsonTokenType.Null)
+ age = new Option(utf8JsonReader.GetInt32());
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
@@ -161,22 +161,22 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
}
}
- if (age.IsSet && age.Value == null)
- throw new ArgumentNullException(nameof(age), "Property is not nullable for class Child.");
-
- if (firstName.IsSet && firstName.Value == null)
- throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Child.");
+ if (type.IsSet && type.Value == null)
+ throw new ArgumentNullException(nameof(type), "Property is not nullable for class Child.");
if (lastName.IsSet && lastName.Value == null)
throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Child.");
- if (type.IsSet && type.Value == null)
- throw new ArgumentNullException(nameof(type), "Property is not nullable for class Child.");
+ if (firstName.IsSet && firstName.Value == null)
+ throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Child.");
+
+ if (age.IsSet && age.Value == null)
+ throw new ArgumentNullException(nameof(age), "Property is not nullable for class Child.");
if (boosterSeat.IsSet && boosterSeat.Value == null)
throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child.");
- return new Child(age, firstName, lastName, boosterSeat);
+ return new Child(lastName, firstName, age, boosterSeat);
}
///
@@ -203,22 +203,22 @@ public override void Write(Utf8JsonWriter writer, Child child, JsonSerializerOpt
///
public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOptions jsonSerializerOptions)
{
- if (child.FirstNameOption.IsSet && child.FirstName == null)
- throw new ArgumentNullException(nameof(child.FirstName), "Property is required for class Child.");
-
if (child.LastNameOption.IsSet && child.LastName == null)
throw new ArgumentNullException(nameof(child.LastName), "Property is required for class Child.");
- if (child.AgeOption.IsSet)
- writer.WriteNumber("age", child.AgeOption.Value.Value);
+ if (child.FirstNameOption.IsSet && child.FirstName == null)
+ throw new ArgumentNullException(nameof(child.FirstName), "Property is required for class Child.");
- if (child.FirstNameOption.IsSet)
- writer.WriteString("firstName", child.FirstName);
+ writer.WriteString("$_type", child.Type);
if (child.LastNameOption.IsSet)
writer.WriteString("lastName", child.LastName);
- writer.WriteString("$_type", child.Type);
+ if (child.FirstNameOption.IsSet)
+ writer.WriteString("firstName", child.FirstName);
+
+ if (child.AgeOption.IsSet)
+ writer.WriteNumber("age", child.AgeOption.Value.Value);
if (child.BoosterSeatOption.IsSet)
writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value);
diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Person.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Person.cs
index c1944c790144..5746d070c507 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Person.cs
+++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Person.cs
@@ -32,30 +32,24 @@ public partial class Person : IValidatableObject
///
/// Initializes a new instance of the class.
///
- /// firstName
/// lastName
+ /// firstName
[JsonConstructor]
- public Person(Option firstName = default, Option lastName = default)
+ public Person(Option lastName = default, Option firstName = default)
{
- FirstNameOption = firstName;
LastNameOption = lastName;
+ FirstNameOption = firstName;
OnCreated();
}
partial void OnCreated();
///
- /// Used to track the state of FirstName
+ /// The discriminator
///
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public Option FirstNameOption { get; private set; }
-
- ///
- /// Gets or Sets FirstName
- ///
- [JsonPropertyName("firstName")]
- public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } }
+ public string Type { get; } = "Person";
///
/// Used to track the state of LastName
@@ -71,11 +65,17 @@ public Person(Option firstName = default, Option lastName = defa
public string LastName { get { return this.LastNameOption; } set { this.LastNameOption = new Option(value); } }
///
- /// The discriminator
+ /// Used to track the state of FirstName
///
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public string Type { get; } = "Person";
+ public Option FirstNameOption { get; private set; }
+
+ ///
+ /// Gets or Sets FirstName
+ ///
+ [JsonPropertyName("firstName")]
+ public string FirstName { get { return this.FirstNameOption; } set { this.FirstNameOption = new Option(value); } }
///
/// Gets or Sets additional properties
@@ -91,8 +91,8 @@ public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Person {\n");
- sb.Append(" FirstName: ").Append(FirstName).Append("\n");
sb.Append(" LastName: ").Append(LastName).Append("\n");
+ sb.Append(" FirstName: ").Append(FirstName).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -141,9 +141,9 @@ public override Person Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
- Option firstName = default;
- Option lastName = default;
Option type = default;
+ Option lastName = default;
+ Option firstName = default;
string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "$_type");
@@ -168,14 +168,14 @@ public override Person Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver
switch (localVarJsonPropertyName)
{
- case "firstName":
- firstName = new Option(utf8JsonReader.GetString());
+ case "$_type":
+ type = new Option(utf8JsonReader.GetString());
break;
case "lastName":
lastName = new Option(utf8JsonReader.GetString());
break;
- case "$_type":
- type = new Option(utf8JsonReader.GetString());
+ case "firstName":
+ firstName = new Option(utf8JsonReader.GetString());
break;
default:
break;
@@ -183,16 +183,16 @@ public override Person Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver
}
}
- if (firstName.IsSet && firstName.Value == null)
- throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Person.");
+ if (type.IsSet && type.Value == null)
+ throw new ArgumentNullException(nameof(type), "Property is not nullable for class Person.");
if (lastName.IsSet && lastName.Value == null)
throw new ArgumentNullException(nameof(lastName), "Property is not nullable for class Person.");
- if (type.IsSet && type.Value == null)
- throw new ArgumentNullException(nameof(type), "Property is not nullable for class Person.");
+ if (firstName.IsSet && firstName.Value == null)
+ throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Person.");
- return new Person(firstName, lastName);
+ return new Person(lastName, firstName);
}
///
@@ -229,19 +229,19 @@ public override void Write(Utf8JsonWriter writer, Person person, JsonSerializerO
///
public void WriteProperties(Utf8JsonWriter writer, Person person, JsonSerializerOptions jsonSerializerOptions)
{
- if (person.FirstNameOption.IsSet && person.FirstName == null)
- throw new ArgumentNullException(nameof(person.FirstName), "Property is required for class Person.");
-
if (person.LastNameOption.IsSet && person.LastName == null)
throw new ArgumentNullException(nameof(person.LastName), "Property is required for class Person.");
- if (person.FirstNameOption.IsSet)
- writer.WriteString("firstName", person.FirstName);
+ if (person.FirstNameOption.IsSet && person.FirstName == null)
+ throw new ArgumentNullException(nameof(person.FirstName), "Property is required for class Person.");
+
+ writer.WriteString("$_type", person.Type);
if (person.LastNameOption.IsSet)
writer.WriteString("lastName", person.LastName);
- writer.WriteString("$_type", person.Type);
+ if (person.FirstNameOption.IsSet)
+ writer.WriteString("firstName", person.FirstName);
}
}
}
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
index 8e9abed3c227..e2408ad1694f 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
@@ -891,7 +891,7 @@ No authorization required
# **TestBodyWithQueryParams**
-> void TestBodyWithQueryParams (User user, string query)
+> void TestBodyWithQueryParams (string query, User user)
@@ -912,12 +912,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
- var user = new User(); // User |
var query = "query_example"; // string |
+ var user = new User(); // User |
try
{
- apiInstance.TestBodyWithQueryParams(user, query);
+ apiInstance.TestBodyWithQueryParams(query, user);
}
catch (ApiException e)
{
@@ -936,7 +936,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
- apiInstance.TestBodyWithQueryParamsWithHttpInfo(user, query);
+ apiInstance.TestBodyWithQueryParamsWithHttpInfo(query, user);
}
catch (ApiException e)
{
@@ -950,8 +950,8 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
-| **user** | [**User**](User.md) | | |
| **query** | **string** | | |
+| **user** | [**User**](User.md) | | |
### Return type
@@ -1067,7 +1067,7 @@ No authorization required
# **TestEndpointParameters**
-> void TestEndpointParameters (byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, DateTime date = null, System.IO.Stream binary = null, float varFloat = null, int integer = null, int int32 = null, long int64 = null, string varString = null, string password = null, string callback = null, DateTime dateTime = null)
+> void TestEndpointParameters (decimal number, double varDouble, string patternWithoutDelimiter, byte[] varByte, int integer = null, int int32 = null, long int64 = null, float varFloat = null, string varString = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -1094,25 +1094,25 @@ namespace Example
config.Password = "YOUR_PASSWORD";
var apiInstance = new FakeApi(config);
- var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None
var number = 8.14D; // decimal | None
var varDouble = 1.2D; // double | None
var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None
- var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional)
- var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional)
- var varFloat = 3.4F; // float | None (optional)
+ var varByte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None
var integer = 56; // int | None (optional)
var int32 = 56; // int | None (optional)
var int64 = 789L; // long | None (optional)
+ var varFloat = 3.4F; // float | None (optional)
var varString = "varString_example"; // string | None (optional)
+ var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional)
+ var date = DateTime.Parse("2013-10-20"); // DateTime | None (optional)
+ var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00")
var password = "password_example"; // string | None (optional)
var callback = "callback_example"; // string | None (optional)
- var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime | None (optional) (default to "2010-02-01T10:20:10.111110+01:00")
try
{
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- apiInstance.TestEndpointParameters(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime);
+ apiInstance.TestEndpointParameters(number, varDouble, patternWithoutDelimiter, varByte, integer, int32, int64, varFloat, varString, binary, date, dateTime, password, callback);
}
catch (ApiException e)
{
@@ -1132,7 +1132,7 @@ This returns an ApiResponse object which contains the response data, status code
try
{
// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- apiInstance.TestEndpointParametersWithHttpInfo(varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime);
+ apiInstance.TestEndpointParametersWithHttpInfo(number, varDouble, patternWithoutDelimiter, varByte, integer, int32, int64, varFloat, varString, binary, date, dateTime, password, callback);
}
catch (ApiException e)
{
@@ -1146,20 +1146,20 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
-| **varByte** | **byte[]** | None | |
| **number** | **decimal** | None | |
| **varDouble** | **double** | None | |
| **patternWithoutDelimiter** | **string** | None | |
-| **date** | **DateTime** | None | [optional] |
-| **binary** | **System.IO.Stream****System.IO.Stream** | None | [optional] |
-| **varFloat** | **float** | None | [optional] |
+| **varByte** | **byte[]** | None | |
| **integer** | **int** | None | [optional] |
| **int32** | **int** | None | [optional] |
| **int64** | **long** | None | [optional] |
+| **varFloat** | **float** | None | [optional] |
| **varString** | **string** | None | [optional] |
+| **binary** | **System.IO.Stream****System.IO.Stream** | None | [optional] |
+| **date** | **DateTime** | None | [optional] |
+| **dateTime** | **DateTime** | None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] |
| **password** | **string** | None | [optional] |
| **callback** | **string** | None | [optional] |
-| **dateTime** | **DateTime** | None | [optional] [default to "2010-02-01T10:20:10.111110+01:00"] |
### Return type
@@ -1185,7 +1185,7 @@ void (empty response body)
# **TestEnumParameters**
-> void TestEnumParameters (List enumHeaderStringArray = null, List enumQueryStringArray = null, List enumFormStringArray = null, TestEnumParametersEnumHeaderStringParameter enumHeaderString = null, TestEnumParametersEnumHeaderStringParameter enumQueryString = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersRequestEnumFormString enumFormString = null)
+> void TestEnumParameters (List enumHeaderStringArray = null, TestEnumParametersEnumHeaderStringParameter enumHeaderString = null, List enumQueryStringArray = null, TestEnumParametersEnumHeaderStringParameter enumQueryString = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, List enumFormStringArray = null, TestEnumParametersRequestEnumFormString enumFormString = null)
To test enum parameters
@@ -1209,18 +1209,18 @@ namespace Example
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional)
- var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional)
- var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional)
var enumHeaderString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Header parameter enum test (string) (optional)
+ var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional)
var enumQueryString = (TestEnumParametersEnumHeaderStringParameter) "_abc"; // TestEnumParametersEnumHeaderStringParameter | Query parameter enum test (string) (optional)
- var enumQueryDouble = (TestEnumParametersEnumQueryDoubleParameter) "1.1"; // TestEnumParametersEnumQueryDoubleParameter | Query parameter enum test (double) (optional)
var enumQueryInteger = (TestEnumParametersEnumQueryIntegerParameter) "1"; // TestEnumParametersEnumQueryIntegerParameter | Query parameter enum test (double) (optional)
+ var enumQueryDouble = (TestEnumParametersEnumQueryDoubleParameter) "1.1"; // TestEnumParametersEnumQueryDoubleParameter | Query parameter enum test (double) (optional)
+ var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional)
var enumFormString = (TestEnumParametersRequestEnumFormString) "_abc"; // TestEnumParametersRequestEnumFormString | (optional)
try
{
// To test enum parameters
- apiInstance.TestEnumParameters(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString);
+ apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
}
catch (ApiException e)
{
@@ -1240,7 +1240,7 @@ This returns an ApiResponse object which contains the response data, status code
try
{
// To test enum parameters
- apiInstance.TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumQueryStringArray, enumFormStringArray, enumHeaderString, enumQueryString, enumQueryDouble, enumQueryInteger, enumFormString);
+ apiInstance.TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
}
catch (ApiException e)
{
@@ -1255,12 +1255,12 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **enumHeaderStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Header parameter enum test (string array) | [optional] |
-| **enumQueryStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Query parameter enum test (string array) | [optional] |
-| **enumFormStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Form parameter enum test (string array) | [optional] |
| **enumHeaderString** | **TestEnumParametersEnumHeaderStringParameter** | Header parameter enum test (string) | [optional] |
+| **enumQueryStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Query parameter enum test (string array) | [optional] |
| **enumQueryString** | **TestEnumParametersEnumHeaderStringParameter** | Query parameter enum test (string) | [optional] |
-| **enumQueryDouble** | **TestEnumParametersEnumQueryDoubleParameter** | Query parameter enum test (double) | [optional] |
| **enumQueryInteger** | **TestEnumParametersEnumQueryIntegerParameter** | Query parameter enum test (double) | [optional] |
+| **enumQueryDouble** | **TestEnumParametersEnumQueryDoubleParameter** | Query parameter enum test (double) | [optional] |
+| **enumFormStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Form parameter enum test (string array) | [optional] |
| **enumFormString** | **TestEnumParametersRequestEnumFormString** | | [optional] |
### Return type
@@ -1287,7 +1287,7 @@ No authorization required
# **TestGroupParameters**
-> void TestGroupParameters (bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool booleanGroup = null, int stringGroup = null, long int64Group = null)
+> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null)
Fake endpoint to test group parameters (optional)
@@ -1313,17 +1313,17 @@ namespace Example
config.AccessToken = "YOUR_BEARER_TOKEN";
var apiInstance = new FakeApi(config);
- var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
var requiredStringGroup = 56; // int | Required String in group parameters
+ var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
var requiredInt64Group = 789L; // long | Required Integer in group parameters
- var booleanGroup = true; // bool | Boolean in group parameters (optional)
var stringGroup = 56; // int | String in group parameters (optional)
+ var booleanGroup = true; // bool | Boolean in group parameters (optional)
var int64Group = 789L; // long | Integer in group parameters (optional)
try
{
// Fake endpoint to test group parameters (optional)
- apiInstance.TestGroupParameters(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group);
+ apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
}
catch (ApiException e)
{
@@ -1343,7 +1343,7 @@ This returns an ApiResponse object which contains the response data, status code
try
{
// Fake endpoint to test group parameters (optional)
- apiInstance.TestGroupParametersWithHttpInfo(requiredBooleanGroup, requiredStringGroup, requiredInt64Group, booleanGroup, stringGroup, int64Group);
+ apiInstance.TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
}
catch (ApiException e)
{
@@ -1357,11 +1357,11 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
-| **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | |
| **requiredStringGroup** | **int** | Required String in group parameters | |
+| **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | |
| **requiredInt64Group** | **long** | Required Integer in group parameters | |
-| **booleanGroup** | **bool** | Boolean in group parameters | [optional] |
| **stringGroup** | **int** | String in group parameters | [optional] |
+| **booleanGroup** | **bool** | Boolean in group parameters | [optional] |
| **int64Group** | **long** | Integer in group parameters | [optional] |
### Return type
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md
index 862c66f0beee..22460ea6d2ab 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/PetApi.md
@@ -668,7 +668,7 @@ void (empty response body)
# **UploadFile**
-> ApiResponse UploadFile (long petId, System.IO.Stream file = null, string additionalMetadata = null)
+> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null)
uploads an image
@@ -693,13 +693,13 @@ namespace Example
var apiInstance = new PetApi(config);
var petId = 789L; // long | ID of pet to update
- var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional)
var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
+ var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional)
try
{
// uploads an image
- ApiResponse result = apiInstance.UploadFile(petId, file, additionalMetadata);
+ ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file);
Debug.WriteLine(result);
}
catch (ApiException e)
@@ -720,7 +720,7 @@ This returns an ApiResponse object which contains the response data, status code
try
{
// uploads an image
- ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, file, additionalMetadata);
+ ApiResponse response = apiInstance.UploadFileWithHttpInfo(petId, additionalMetadata, file);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@@ -738,8 +738,8 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **petId** | **long** | ID of pet to update | |
-| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] |
| **additionalMetadata** | **string** | Additional data to pass to server | [optional] |
+| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] |
### Return type
@@ -764,7 +764,7 @@ catch (ApiException e)
# **UploadFileWithRequiredFile**
-> ApiResponse UploadFileWithRequiredFile (System.IO.Stream requiredFile, long petId, string additionalMetadata = null)
+> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null)
uploads an image (required)
@@ -788,14 +788,14 @@ namespace Example
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
- var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload
var petId = 789L; // long | ID of pet to update
+ var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload
var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
try
{
// uploads an image (required)
- ApiResponse result = apiInstance.UploadFileWithRequiredFile(requiredFile, petId, additionalMetadata);
+ ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
Debug.WriteLine(result);
}
catch (ApiException e)
@@ -816,7 +816,7 @@ This returns an ApiResponse object which contains the response data, status code
try
{
// uploads an image (required)
- ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(requiredFile, petId, additionalMetadata);
+ ApiResponse response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@@ -833,8 +833,8 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
-| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | |
| **petId** | **long** | ID of pet to update | |
+| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | |
| **additionalMetadata** | **string** | Additional data to pass to server | [optional] |
### Return type
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md
index ee189c866ec5..8a761998fdbd 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/UserApi.md
@@ -625,7 +625,7 @@ No authorization required
# **UpdateUser**
-> void UpdateUser (User user, string username)
+> void UpdateUser (string username, User user)
Updated user
@@ -648,13 +648,13 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
- var user = new User(); // User | Updated user object
var username = "username_example"; // string | name that need to be deleted
+ var user = new User(); // User | Updated user object
try
{
// Updated user
- apiInstance.UpdateUser(user, username);
+ apiInstance.UpdateUser(username, user);
}
catch (ApiException e)
{
@@ -674,7 +674,7 @@ This returns an ApiResponse object which contains the response data, status code
try
{
// Updated user
- apiInstance.UpdateUserWithHttpInfo(user, username);
+ apiInstance.UpdateUserWithHttpInfo(username, user);
}
catch (ApiException e)
{
@@ -688,8 +688,8 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
-| **user** | [**User**](User.md) | Updated user object | |
| **username** | **string** | name that need to be deleted | |
+| **user** | [**User**](User.md) | Updated user object | |
### Return type
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
index 01eeeb00511b..b8b8d521149e 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
@@ -264,11 +264,11 @@ public interface IFakeApi : IApi
///
///
/// Thrown when fails to make API call
- ///
///
+ ///
/// Cancellation Token to cancel the request.
/// <>
- Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default);
+ Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default);
///
///
@@ -276,11 +276,11 @@ public interface IFakeApi : IApi
///
///
///
- ///
///
+ ///
/// Cancellation Token to cancel the request.
/// <>
- Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default);
+ Task TestBodyWithQueryParamsOrDefaultAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default);
///
/// To test \"client\" model
@@ -312,23 +312,23 @@ public interface IFakeApi : IApi
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
///
/// Thrown when fails to make API call
- /// None
/// None
/// None
/// None
- /// None (optional)
- /// None (optional)
- /// None (optional)
+ /// None
/// None (optional)
/// None (optional)
/// None (optional)
+ /// None (optional)
/// None (optional)
+ /// None (optional)
+ /// None (optional)
+ /// None (optional, default to "2010-02-01T10:20:10.111110+01:00")
/// None (optional)
/// None (optional)
- /// None (optional, default to "2010-02-01T10:20:10.111110+01:00")
/// Cancellation Token to cancel the request.
/// <>
- Task TestEndpointParametersAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEndpointParametersAsync(decimal number, double varDouble, string patternWithoutDelimiter, byte[] varByte, Option integer = default, Option int32 = default, Option int64 = default, Option varFloat = default, Option varString = default, Option binary = default, Option date = default, Option dateTime = default, Option password = default, Option callback = default, System.Threading.CancellationToken cancellationToken = default);
///
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -336,23 +336,23 @@ public interface IFakeApi : IApi
///
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
///
- /// None
/// None
/// None
/// None
- /// None (optional)
- /// None (optional)
- /// None (optional)
+ /// None
/// None (optional)
/// None (optional)
/// None (optional)
+ /// None (optional)
/// None (optional)
+ /// None (optional)
+ /// None (optional)
+ /// None (optional, default to "2010-02-01T10:20:10.111110+01:00")
/// None (optional)
/// None (optional)
- /// None (optional, default to "2010-02-01T10:20:10.111110+01:00")
/// Cancellation Token to cancel the request.
/// <>
- Task TestEndpointParametersOrDefaultAsync(byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date = default, Option binary = default, Option varFloat = default, Option integer = default, Option int32 = default, Option int64 = default, Option varString = default, Option password = default, Option callback = default, Option dateTime = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEndpointParametersOrDefaultAsync(decimal number, double varDouble, string patternWithoutDelimiter, byte[] varByte, Option integer = default, Option int32 = default, Option int64 = default, Option varFloat = default, Option varString = default, Option binary = default, Option date = default, Option dateTime = default, Option password = default, Option callback = default, System.Threading.CancellationToken cancellationToken = default);
///
/// To test enum parameters
@@ -362,16 +362,16 @@ public interface IFakeApi : IApi
///
/// Thrown when fails to make API call
/// Header parameter enum test (string array) (optional)
- /// Query parameter enum test (string array) (optional)
- /// Form parameter enum test (string array) (optional)
/// Header parameter enum test (string) (optional)
+ /// Query parameter enum test (string array) (optional)
/// Query parameter enum test (string) (optional)
- /// Query parameter enum test (double) (optional)
/// Query parameter enum test (double) (optional)
+ /// Query parameter enum test (double) (optional)
+ /// Form parameter enum test (string array) (optional)
/// (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEnumParametersAsync(Option> enumHeaderStringArray = default, Option enumHeaderString = default, Option> enumQueryStringArray = default, Option enumQueryString = default, Option enumQueryInteger = default, Option enumQueryDouble = default, Option> enumFormStringArray = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default);
///
/// To test enum parameters
@@ -380,16 +380,16 @@ public interface IFakeApi : IApi
/// To test enum parameters
///
/// Header parameter enum test (string array) (optional)
- /// Query parameter enum test (string array) (optional)
- /// Form parameter enum test (string array) (optional)
/// Header parameter enum test (string) (optional)
+ /// Query parameter enum test (string array) (optional)
/// Query parameter enum test (string) (optional)
- /// Query parameter enum test (double) (optional)
/// Query parameter enum test (double) (optional)
+ /// Query parameter enum test (double) (optional)
+ /// Form parameter enum test (string array) (optional)
/// (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option> enumQueryStringArray = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option enumQueryString = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEnumParametersOrDefaultAsync(Option> enumHeaderStringArray = default, Option enumHeaderString = default, Option> enumQueryStringArray = default, Option enumQueryString = default, Option enumQueryInteger = default, Option enumQueryDouble = default, Option> enumFormStringArray = default, Option enumFormString = default, System.Threading.CancellationToken cancellationToken = default);
///
/// Fake endpoint to test group parameters (optional)
@@ -398,15 +398,15 @@ public interface IFakeApi : IApi
/// Fake endpoint to test group parameters (optional)
///
/// Thrown when fails to make API call
- /// Required Boolean in group parameters
/// Required String in group parameters
+ /// Required Boolean in group parameters
/// Required Integer in group parameters
- /// Boolean in group parameters (optional)
/// String in group parameters (optional)
+ /// Boolean in group parameters (optional)
/// Integer in group parameters (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestGroupParametersAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestGroupParametersAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, Option stringGroup = default, Option booleanGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default);
///
/// Fake endpoint to test group parameters (optional)
@@ -414,15 +414,15 @@ public interface IFakeApi : IApi
///
/// Fake endpoint to test group parameters (optional)
///
- /// Required Boolean in group parameters
/// Required String in group parameters
+ /// Required Boolean in group parameters
/// Required Integer in group parameters
- /// Boolean in group parameters (optional)
/// String in group parameters (optional)
+ /// Boolean in group parameters (optional)
/// Integer in group parameters (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestGroupParametersOrDefaultAsync(bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, Option booleanGroup = default, Option stringGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestGroupParametersOrDefaultAsync(int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, Option stringGroup = default, Option booleanGroup = default, Option int64Group = default, System.Threading.CancellationToken cancellationToken = default);
///
/// test inline additionalProperties
@@ -3347,33 +3347,33 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht
partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode);
}
- partial void FormatTestBodyWithQueryParams(User user, ref string query);
+ partial void FormatTestBodyWithQueryParams(ref string query, User user);
///
/// Validates the request parameters
///
- ///
///
+ ///
///
- private void ValidateTestBodyWithQueryParams(User user, string query)
+ private void ValidateTestBodyWithQueryParams(string query, User user)
{
- if (user == null)
- throw new ArgumentNullException(nameof(user));
-
if (query == null)
throw new ArgumentNullException(nameof(query));
+
+ if (user == null)
+ throw new ArgumentNullException(nameof(user));
}
///
/// Processes the server response
///
///
- ///
///
- private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query)
+ ///
+ private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, string query, User user)
{
bool suppressDefaultLog = false;
- AfterTestBodyWithQueryParams(ref suppressDefaultLog, apiResponseLocalVar, user, query);
+ AfterTestBodyWithQueryParams(ref suppressDefaultLog, apiResponseLocalVar, query, user);
if (!suppressDefaultLog)
Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path);
}
@@ -3383,9 +3383,9 @@ private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQuer
///
///
///
- ///
///
- partial void AfterTestBodyWithQueryParams(ref bool suppressDefaultLog, ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, User user, string query);
+ ///
+ partial void AfterTestBodyWithQueryParams(ref bool suppressDefaultLog, ITestBodyWithQueryParamsApiResponse apiResponseLocalVar, string query, User user);
///
/// Logs exceptions that occur while retrieving the server response
@@ -3393,12 +3393,12 @@ private void AfterTestBodyWithQueryParamsDefaultImplementation(ITestBodyWithQuer
///
///
///
- ///
///
- private void OnErrorTestBodyWithQueryParamsDefaultImplementation(Exception exception, string pathFormat, string path, User user, string query)
+ ///
+ private void OnErrorTestBodyWithQueryParamsDefaultImplementation(Exception exception, string pathFormat, string path, string query, User user)
{
bool suppressDefaultLog = false;
- OnErrorTestBodyWithQueryParams(ref suppressDefaultLog, exception, pathFormat, path, user, query);
+ OnErrorTestBodyWithQueryParams(ref suppressDefaultLog, exception, pathFormat, path, query, user);
if (!suppressDefaultLog)
Logger.LogError(exception, "An error occurred while sending the request to the server.");
}
@@ -3410,22 +3410,22 @@ private void OnErrorTestBodyWithQueryParamsDefaultImplementation(Exception excep
///
///
///
- ///
///
- partial void OnErrorTestBodyWithQueryParams(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, User user, string query);
+ ///
+ partial void OnErrorTestBodyWithQueryParams(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string query, User user);
///
///
///
- ///
///
+ ///
/// Cancellation Token to cancel the request.
/// <>
- public async Task TestBodyWithQueryParamsOrDefaultAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default)
+ public async Task TestBodyWithQueryParamsOrDefaultAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default)
{
try
{
- return await TestBodyWithQueryParamsAsync(user, query, cancellationToken).ConfigureAwait(false);
+ return await TestBodyWithQueryParamsAsync(query, user, cancellationToken).ConfigureAwait(false);
}
catch (Exception)
{
@@ -3437,19 +3437,19 @@ public async Task TestBodyWithQueryParamsOr
///
///
/// Thrown when fails to make API call
- ///
///
+ ///
/// Cancellation Token to cancel the request.
/// <>
- public async Task TestBodyWithQueryParamsAsync(User user, string query, System.Threading.CancellationToken cancellationToken = default)
+ public async Task TestBodyWithQueryParamsAsync(string query, User user, System.Threading.CancellationToken cancellationToken = default)
{
UriBuilder uriBuilderLocalVar = new UriBuilder();
try
{
- ValidateTestBodyWithQueryParams(user, query);
+ ValidateTestBodyWithQueryParams(query, user);
- FormatTestBodyWithQueryParams(user, ref query);
+ FormatTestBodyWithQueryParams(ref query, user);
using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage())
{
@@ -3491,7 +3491,7 @@ public async Task TestBodyWithQueryParamsAs
TestBodyWithQueryParamsApiResponse apiResponseLocalVar = new TestBodyWithQueryParamsApiResponse(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/fake/body-with-query-params", requestedAtLocalVar, _jsonSerializerOptions);
- AfterTestBodyWithQueryParamsDefaultImplementation(apiResponseLocalVar, user, query);
+ AfterTestBodyWithQueryParamsDefaultImplementation(apiResponseLocalVar, query, user);
Events.ExecuteOnTestBodyWithQueryParams(apiResponseLocalVar);
@@ -3501,7 +3501,7 @@ public async Task TestBodyWithQueryParamsAs
}
catch(Exception e)
{
- OnErrorTestBodyWithQueryParamsDefaultImplementation(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, user, query);
+ OnErrorTestBodyWithQueryParamsDefaultImplementation(e, "/fake/body-with-query-params", uriBuilderLocalVar.Path, query, user);
Events.ExecuteOnErrorTestBodyWithQueryParams(e);
throw;
}
@@ -3781,32 +3781,32 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht
partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode);
}
- partial void FormatTestEndpointParameters(ref byte[] varByte, ref decimal number, ref double varDouble, ref string patternWithoutDelimiter, ref Option date, ref Option binary, ref Option varFloat, ref Option integer, ref Option int32, ref Option int64, ref Option varString, ref Option password, ref Option callback, ref Option dateTime);
+ partial void FormatTestEndpointParameters(ref decimal number, ref double varDouble, ref string patternWithoutDelimiter, ref byte[] varByte, ref Option integer, ref Option int32, ref Option int64, ref Option varFloat, ref Option varString, ref Option binary, ref Option date, ref Option dateTime, ref Option password, ref Option callback);
///
/// Validates the request parameters
///
- ///
///
- ///
+ ///
///
+ ///
///
///
///
- private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback)
+ private void ValidateTestEndpointParameters(string patternWithoutDelimiter, byte[] varByte, Option varString, Option binary, Option password, Option callback)
{
- if (varByte == null)
- throw new ArgumentNullException(nameof(varByte));
-
if (patternWithoutDelimiter == null)
throw new ArgumentNullException(nameof(patternWithoutDelimiter));
- if (binary.IsSet && binary.Value == null)
- throw new ArgumentNullException(nameof(binary));
+ if (varByte == null)
+ throw new ArgumentNullException(nameof(varByte));
if (varString.IsSet && varString.Value == null)
throw new ArgumentNullException(nameof(varString));
+ if (binary.IsSet && binary.Value == null)
+ throw new ArgumentNullException(nameof(binary));
+
if (password.IsSet && password.Value == null)
throw new ArgumentNullException(nameof(password));
@@ -3818,24 +3818,24 @@ private void ValidateTestEndpointParameters(byte[] varByte, string patternWithou
/// Processes the server response
///
///
- ///
///
///
///
- ///
- ///
- ///
+ ///
///
///
///
+ ///
///
+ ///
+ ///
+ ///
///
///
- ///
- private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime)
+ private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParametersApiResponse apiResponseLocalVar, decimal number, double varDouble, string patternWithoutDelimiter, byte[] varByte, Option integer, Option int32, Option int64, Option varFloat, Option varString, Option binary, Option date, Option dateTime, Option password, Option callback)
{
bool suppressDefaultLog = false;
- AfterTestEndpointParameters(ref suppressDefaultLog, apiResponseLocalVar, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime);
+ AfterTestEndpointParameters(ref suppressDefaultLog, apiResponseLocalVar, number, varDouble, patternWithoutDelimiter, varByte, integer, int32, int64, varFloat, varString, binary, date, dateTime, password, callback);
if (!suppressDefaultLog)
Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path);
}
@@ -3845,21 +3845,21 @@ private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParam
///
///
///
- ///
///
///
///
- ///
- ///
- ///
+ ///
///
///
///
+ ///
///
+ ///
+ ///
+ ///
///
///
- ///
- partial void AfterTestEndpointParameters(ref bool suppressDefaultLog, ITestEndpointParametersApiResponse apiResponseLocalVar, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime);
+ partial void AfterTestEndpointParameters(ref bool suppressDefaultLog, ITestEndpointParametersApiResponse apiResponseLocalVar, decimal number, double varDouble, string patternWithoutDelimiter, byte[] varByte, Option integer, Option int32, Option int64, Option varFloat, Option varString, Option binary, Option date, Option dateTime, Option password, Option callback);
///
/// Logs exceptions that occur while retrieving the server response
@@ -3867,24 +3867,24 @@ private void AfterTestEndpointParametersDefaultImplementation(ITestEndpointParam
///
///
///
- ///
///
///
///
- ///
- ///
- ///
+ ///
///
///
///
+ ///
///
+ ///
+ ///
+ ///
///
///
- ///
- private void OnErrorTestEndpointParametersDefaultImplementation(Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime)
+ private void OnErrorTestEndpointParametersDefaultImplementation(Exception exception, string pathFormat, string path, decimal number, double varDouble, string patternWithoutDelimiter, byte[] varByte, Option integer, Option int32, Option int64, Option varFloat, Option varString, Option binary, Option date, Option dateTime, Option password, Option callback)
{
bool suppressDefaultLog = false;
- OnErrorTestEndpointParameters(ref suppressDefaultLog, exception, pathFormat, path, varByte, number, varDouble, patternWithoutDelimiter, date, binary, varFloat, integer, int32, int64, varString, password, callback, dateTime);
+ OnErrorTestEndpointParameters(ref suppressDefaultLog, exception, pathFormat, path, number, varDouble, patternWithoutDelimiter, varByte, integer, int32, int64, varFloat, varString, binary, date, dateTime, password, callback);
if (!suppressDefaultLog)
Logger.LogError(exception, "An error occurred while sending the request to the server.");
}
@@ -3896,46 +3896,46 @@ private void OnErrorTestEndpointParametersDefaultImplementation(Exception except
///
///
///
- ///
///
///
///
- ///
- ///
- ///
+ ///
///
///
///
+ ///
///
+ ///
+ ///
+ ///
///
///
- ///
- partial void OnErrorTestEndpointParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, byte[] varByte, decimal number, double varDouble, string patternWithoutDelimiter, Option date, Option binary, Option varFloat, Option integer, Option int32, Option int64, Option varString, Option password, Option callback, Option dateTime);
+ partial void OnErrorTestEndpointParameters(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, decimal number, double varDouble, string patternWithoutDelimiter, byte[] varByte, Option