Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
{{#hasOnlyReadOnly}}
[JsonConstructorAttribute]
{{/hasOnlyReadOnly}}
public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default{{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}}
public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#conditionalSerialization}}{{#vendorExtensions.x-csharp-value-type}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/vendorExtensions.x-csharp-value-type}}{{/conditionalSerialization}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default{{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: For nullable value-type properties (spec nullable: true), the new ? appended here may collide with an existing ? already present in datatypeWithEnum/dataType, producing an invalid int?? parameter type (compile error) instead of int?. The C# codegen appends ? to nullable value-type dataTypes (CSharpClientCodegen around line 654: if (isSupportNullable() && ModelUtils.isNullable(p) && this.getNullableTypes().contains(type))), so the type may already end in ?. Unlike the enum branch, which is unguarded here, the new value-type branch should only append ? when datatypeWithEnum does not already end in ?. The conditional-serialization sample only covers plain bool/integer (non-nullable), so this path is untested. Please verify that an optional nullable value-type property does not generate ?? and guard the ? accordingly (e.g. also require the type not to already end with ?).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache, line 143:

<comment>For nullable value-type properties (spec `nullable: true`), the new `?` appended here may collide with an existing `?` already present in `datatypeWithEnum`/`dataType`, producing an invalid `int??` parameter type (compile error) instead of `int?`. The C# codegen appends `?` to nullable value-type dataTypes (CSharpClientCodegen around line 654: `if (isSupportNullable() && ModelUtils.isNullable(p) && this.getNullableTypes().contains(type))`), so the type may already end in `?`. Unlike the enum branch, which is unguarded here, the new value-type branch should only append `?` when `datatypeWithEnum` does not already end in `?`. The conditional-serialization sample only covers plain `bool`/`integer` (non-nullable), so this path is untested. Please verify that an optional nullable value-type property does not generate `??` and guard the `?` accordingly (e.g. also require the type not to already end with `?`).</comment>

<file context>
@@ -140,7 +140,7 @@
         [JsonConstructorAttribute]
     {{/hasOnlyReadOnly}}
-        public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default{{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}}
+        public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#conditionalSerialization}}{{#vendorExtensions.x-csharp-value-type}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/vendorExtensions.x-csharp-value-type}}{{/conditionalSerialization}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default{{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}}
         {
             {{#vars}}
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this against the generator; the T?? case does not occur. The appended ? sits inside {{#vendorExtensions.x-csharp-value-type}}, and CSharpClientCodegen.patchProperty sets that flag only when getNullableTypes() contains property.dataType. That set holds the bare names (int, bool, DateTime, ...), so a nullable: true property whose dataType is already int? never gets the flag. It keeps the original template path: int? graceDays as the parameter, with the existing if (this.GraceDays != null) check, which is meaningful for a nullable type. Enums never end in ? in datatypeWithEnum (the name is StatusEnum even when nullable), so the enum branch appends exactly one ?, as it did before this PR.

I verified this by generating a model with nullable int/bool, an inline enum, a nullable inline enum and a $ref enum for httpclient, restsharp and unityWebRequest, with and without nullableReferenceTypes. No ?? appears, and the httpclient/net8.0 output builds with 0 errors and 0 warnings.

In dfc897f I added a nullable integer and a nullable enum to the test fixture, and asserted that no ?? is emitted and that the nullable value type keeps its original null check. That locks this in, so a future change to the value-type extension cannot silently regress it.

{
{{#vars}}
{{^isInherited}}
Expand Down Expand Up @@ -196,11 +196,20 @@
this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
{{/conditionalSerialization}}
{{#conditionalSerialization}}
{{#vendorExtensions.x-csharp-value-type}}
if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null)
{
this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.Value;
this._flag{{name}} = true;
}
{{/vendorExtensions.x-csharp-value-type}}
{{^vendorExtensions.x-csharp-value-type}}
this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
if (this.{{name}} != null)
{
this._flag{{name}} = true;
}
{{/vendorExtensions.x-csharp-value-type}}
{{/conditionalSerialization}}
{{/defaultValue}}
{{/required}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,78 @@ public void testMapResponse() throws Exception {
Assert.assertTrue(cr1.isMap);
}

@Test(description = "conditionalSerialization: an all-optional model's public constructor must not raise the serialization flag for value-typed properties the caller never passed")
public void testConditionalSerializationValueTypeConstructorFlags() throws IOException {
Map<String, File> files = generateConditionalSerializationValueTypeModels(true);

File updateCommand = files.get("UpdateThingCommand.cs");
assertNotNull(updateCommand);
// value-typed parameters become nullable so "not passed" is representable ...
assertFileContains(updateCommand.toPath(),
"public UpdateThingCommand(bool? autoRenew = default, int? period = default, int? graceDays = default, StatusEnum? status = default, RenewalModeEnum? renewalMode = default, string note = default)");
// ... and the flag is only raised for arguments that were actually provided
assertFileContains(updateCommand.toPath(),
"if (autoRenew != null)\n" +
" {\n" +
" this._AutoRenew = autoRenew.Value;\n" +
" this._flagAutoRenew = true;\n" +
" }");
// optional enums take the same guarded path
assertFileContains(updateCommand.toPath(),
"if (status != null)\n" +
" {\n" +
" this._Status = status.Value;\n" +
" this._flagStatus = true;\n" +
" }");
// a nullable value type already had a meaningful null check and keeps it
assertFileContains(updateCommand.toPath(),
"this._GraceDays = graceDays;\n" +
" if (this.GraceDays != null)\n" +
" {\n" +
" this._flagGraceDays = true;\n" +
" }");
// the public property surface is untouched: plain value types, flag-raising setters
assertFileContains(updateCommand.toPath(), "public bool AutoRenew", "public int Period");
assertFileNotContains(updateCommand.toPath(), "public bool? AutoRenew", "public int? Period");

// required value-typed properties keep their non-nullable parameter and unconditional assignment
File createCommand = files.get("CreateThingCommand.cs");
assertNotNull(createCommand);
assertFileContains(createCommand.toPath(),
"public CreateThingCommand(string name = default, bool autoRenew = default, string note = default)");
assertFileContains(createCommand.toPath(), "this._AutoRenew = autoRenew;");
assertFileNotContains(createCommand.toPath(), "autoRenew.Value");
}

@Test(description = "without conditionalSerialization the constructor keeps plain value-typed parameters")
public void testValueTypeConstructorUnchangedWithoutConditionalSerialization() throws IOException {
Map<String, File> files = generateConditionalSerializationValueTypeModels(false);

File updateCommand = files.get("UpdateThingCommand.cs");
assertNotNull(updateCommand);
assertFileContains(updateCommand.toPath(),
"public UpdateThingCommand(bool autoRenew = default, int period = default, int? graceDays = default, StatusEnum? status = default, RenewalModeEnum? renewalMode = default, string note = default)");
assertFileNotContains(updateCommand.toPath(), "_flagAutoRenew");
}

private Map<String, File> generateConditionalSerializationValueTypeModels(boolean conditionalSerialization) throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/csharp/conditional-serialization-value-types.yaml");
final DefaultGenerator defaultGenerator = new DefaultGenerator();
final ClientOptInput clientOptInput = new ClientOptInput();
clientOptInput.openAPI(openAPI);
CSharpClientCodegen cSharpClientCodegen = new CSharpClientCodegen();
cSharpClientCodegen.setLibrary("httpclient");
cSharpClientCodegen.setOutputDir(output.getAbsolutePath());
cSharpClientCodegen.additionalProperties().put(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION, String.valueOf(conditionalSerialization));
clientOptInput.config(cSharpClientCodegen);
defaultGenerator.opts(clientOptInput);

return defaultGenerator.generate().stream()
.collect(Collectors.toMap(File::getName, Function.identity(), (first, second) -> first));
}

private Map<String, File> generateIssue23046Models(boolean nonPublicApi) throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
openapi: 3.0.3
info:
title: conditional serialization value-type flags
version: 1.0.0
paths:
/things:
post:
operationId: createThing
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateThingCommand'
responses:
'200':
description: created
patch:
operationId: updateThing
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateThingCommand'
responses:
'200':
description: updated
components:
schemas:
UpdateThingCommand:
type: object
description: an all-optional partial-update command; its only constructor is the public one
properties:
autoRenew:
type: boolean
period:
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
type: integer
graceDays:
type: integer
nullable: true
status:
type: string
enum: [active, suspended]
renewalMode:
type: string
enum: [manual, automatic]
nullable: true
note:
type: string
CreateThingCommand:
type: object
description: required value type keeps its non-nullable constructor parameter
required:
- name
- autoRenew
properties:
name:
type: string
autoRenew:
type: boolean
note:
type: string
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public partial class ApiResponse : IEquatable<ApiResponse>, IValidatableObject
/// <param name="code">code.</param>
/// <param name="type">type.</param>
/// <param name="message">message.</param>
public ApiResponse(int code = default, string type = default, string message = default)
public ApiResponse(int? code = default, string type = default, string message = default)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Changing int to int? changes the public CLR constructor signature, so an already-compiled consumer calling ApiResponse(int, string, string) fails with MissingMethodException after upgrading this library. Preserve the old constructor signature as a compatibility overload and delegate it to the nullable implementation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs, line 41:

<comment>Changing `int` to `int?` changes the public CLR constructor signature, so an already-compiled consumer calling `ApiResponse(int, string, string)` fails with `MissingMethodException` after upgrading this library. Preserve the old constructor signature as a compatibility overload and delegate it to the nullable implementation.</comment>

<file context>
@@ -38,11 +38,11 @@ public partial class ApiResponse : IEquatable<ApiResponse>, IValidatableObject
         /// <param name="type">type.</param>
         /// <param name="message">message.</param>
-        public ApiResponse(int code = default, string type = default, string message = default)
+        public ApiResponse(int? code = default, string type = default, string message = default)
         {
-            this._Code = code;
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLR signature does change, but I am deliberately not adding a compatibility overload. The overload would break source compatibility and bring the bug back. I tested this with the exact pair it would generate (C# 12, net8.0):

public ApiResponse(int? code = default, string type = default, string message = default)  // new
public ApiResponse(int code = default, string type = default, string message = default)   // compat overload
  • new ApiResponse() and new ApiResponse(message: "x"): error CS0121, "The call is ambiguous between ApiResponse(int?, string, string) and ApiResponse(int, string, string)". Every model with an optional value-typed property would stop compiling for callers that skip that argument. Partial-update calls are exactly that shape.
  • new ApiResponse(code: 5) binds to the int overload, because the identity conversion is better than int to int?. So every caller who passes a value-typed argument goes back to the flag-raising constructor this PR fixes.

A consumer who recompiles against the regenerated model (the normal workflow for generated code) picks up the new constructor with no source changes, because int converts implicitly to int?. The only scenario left is swapping in a regenerated assembly without rebuilding its callers. The generator already gives no guarantees for that: the model has a single all-parameter constructor, so adding any optional property to the spec changes its CLR signature in the same way. The change is also limited to conditionalSerialization=true, which only one sample in the repo uses. I will call out the signature change in the PR description so it can go into the release notes.

{
this._Code = code;
if (this.Code != null)
if (code != null)
{
this._Code = code.Value;
this._flagCode = true;
}
this._Type = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ protected AppleReq() { }
/// </summary>
/// <param name="cultivar">cultivar (required).</param>
/// <param name="mealy">mealy.</param>
public AppleReq(string cultivar = default, bool mealy = default)
public AppleReq(string cultivar = default, bool? mealy = default)
{
// to ensure "cultivar" is required (not null)
if (cultivar == null)
{
throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null");
}
this._Cultivar = cultivar;
this._Mealy = mealy;
if (this.Mealy != null)
if (mealy != null)
{
this._Mealy = mealy.Value;
this._flagMealy = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public partial class Banana : IEquatable<Banana>, IValidatableObject
/// Initializes a new instance of the <see cref="Banana" /> class.
/// </summary>
/// <param name="lengthCm">lengthCm.</param>
public Banana(decimal lengthCm = default)
public Banana(decimal? lengthCm = default)
{
this._LengthCm = lengthCm;
if (this.LengthCm != null)
if (lengthCm != null)
{
this._LengthCm = lengthCm.Value;
this._flagLengthCm = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ protected BananaReq() { }
/// </summary>
/// <param name="lengthCm">lengthCm (required).</param>
/// <param name="sweet">sweet.</param>
public BananaReq(decimal lengthCm = default, bool sweet = default)
public BananaReq(decimal lengthCm = default, bool? sweet = default)
{
this._LengthCm = lengthCm;
this._Sweet = sweet;
if (this.Sweet != null)
if (sweet != null)
{
this._Sweet = sweet.Value;
this._flagSweet = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
/// <param name="declawed">declawed.</param>
/// <param name="className">className (required) (default to &quot;Cat&quot;).</param>
/// <param name="color">color (default to &quot;red&quot;).</param>
public Cat(bool declawed = default, string className = @"Cat", string color = @"red") : base(className, color)
public Cat(bool? declawed = default, string className = @"Cat", string color = @"red") : base(className, color)
{
this._Declawed = declawed;
if (this.Declawed != null)
if (declawed != null)
{
this._Declawed = declawed.Value;
this._flagDeclawed = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
Expand Down Expand Up @@ -85,7 +85,7 @@
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }

Check warning on line 88 in samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs

View workflow job for this annotation

GitHub Actions / Build clients (samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/)

'Cat.AdditionalProperties' hides inherited member 'Animal.AdditionalProperties'. Use the new keyword if hiding was intended.

Check warning on line 88 in samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs

View workflow job for this annotation

GitHub Actions / Build .Net Standard projects (samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSer...

'Cat.AdditionalProperties' hides inherited member 'Animal.AdditionalProperties'. Use the new keyword if hiding was intended.

/// <summary>
/// Returns the string presentation of the object
Expand Down Expand Up @@ -164,7 +164,7 @@
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
protected IEnumerable<ValidationResult> BaseValidate(ValidationContext validationContext)

Check warning on line 167 in samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs

View workflow job for this annotation

GitHub Actions / Build clients (samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/)

'Cat.BaseValidate(ValidationContext)' hides inherited member 'Animal.BaseValidate(ValidationContext)'. Use the new keyword if hiding was intended.

Check warning on line 167 in samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs

View workflow job for this annotation

GitHub Actions / Build .Net Standard projects (samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSer...

'Cat.BaseValidate(ValidationContext)' hides inherited member 'Animal.BaseValidate(ValidationContext)'. Use the new keyword if hiding was intended.
{
foreach (var x in base.BaseValidate(validationContext))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ protected Category()
/// </summary>
/// <param name="id">id.</param>
/// <param name="name">name (required) (default to &quot;default-name&quot;).</param>
public Category(long id = default, string name = @"default-name")
public Category(long? id = default, string name = @"default-name")
{
// to ensure "name" is required (not null)
if (name == null)
{
throw new ArgumentNullException("name is a required property for Category and cannot be null");
}
this._Name = name;
this._Id = id;
if (this.Id != null)
if (id != null)
{
this._Id = id.Value;
this._flagId = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public partial class DateOnlyClass : IEquatable<DateOnlyClass>, IValidatableObje
/// Initializes a new instance of the <see cref="DateOnlyClass" /> class.
/// </summary>
/// <param name="dateOnlyProperty">dateOnlyProperty.</param>
public DateOnlyClass(DateTime dateOnlyProperty = default)
public DateOnlyClass(DateTime? dateOnlyProperty = default)
{
this._DateOnlyProperty = dateOnlyProperty;
if (this.DateOnlyProperty != null)
if (dateOnlyProperty != null)
{
this._DateOnlyProperty = dateOnlyProperty.Value;
this._flagDateOnlyProperty = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public enum ArrayEnumEnum
/// <param name="arrayEnum">arrayEnum.</param>
public EnumArrays(JustSymbolEnum? justSymbol = default, List<ArrayEnumEnum> arrayEnum = default)
{
this._JustSymbol = justSymbol;
if (this.JustSymbol != null)
if (justSymbol != null)
{
this._JustSymbol = justSymbol.Value;
this._flagJustSymbol = true;
}
this._ArrayEnum = arrayEnum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,44 +450,44 @@ protected EnumTest()
public EnumTest(EnumStringEnum? enumString = default, EnumStringRequiredEnum enumStringRequired = default, EnumIntegerEnum? enumInteger = default, EnumIntegerOnlyEnum? enumIntegerOnly = default, EnumNumberEnum? enumNumber = default, OuterEnum? outerEnum = default, OuterEnumInteger? outerEnumInteger = default, OuterEnumDefaultValue? outerEnumDefaultValue = default, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default)
{
this._EnumStringRequired = enumStringRequired;
this._EnumString = enumString;
if (this.EnumString != null)
if (enumString != null)
{
this._EnumString = enumString.Value;
this._flagEnumString = true;
}
this._EnumInteger = enumInteger;
if (this.EnumInteger != null)
if (enumInteger != null)
{
this._EnumInteger = enumInteger.Value;
this._flagEnumInteger = true;
}
this._EnumIntegerOnly = enumIntegerOnly;
if (this.EnumIntegerOnly != null)
if (enumIntegerOnly != null)
{
this._EnumIntegerOnly = enumIntegerOnly.Value;
this._flagEnumIntegerOnly = true;
}
this._EnumNumber = enumNumber;
if (this.EnumNumber != null)
if (enumNumber != null)
{
this._EnumNumber = enumNumber.Value;
this._flagEnumNumber = true;
}
this._OuterEnum = outerEnum;
if (this.OuterEnum != null)
if (outerEnum != null)
{
this._OuterEnum = outerEnum.Value;
this._flagOuterEnum = true;
}
this._OuterEnumInteger = outerEnumInteger;
if (this.OuterEnumInteger != null)
if (outerEnumInteger != null)
{
this._OuterEnumInteger = outerEnumInteger.Value;
this._flagOuterEnumInteger = true;
}
this._OuterEnumDefaultValue = outerEnumDefaultValue;
if (this.OuterEnumDefaultValue != null)
if (outerEnumDefaultValue != null)
{
this._OuterEnumDefaultValue = outerEnumDefaultValue.Value;
this._flagOuterEnumDefaultValue = true;
}
this._OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
if (this.OuterEnumIntegerDefaultValue != null)
if (outerEnumIntegerDefaultValue != null)
{
this._OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue.Value;
this._flagOuterEnumIntegerDefaultValue = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
Expand Down
Loading
Loading