[C#] Fixed issue #1126 with invalid generation of C# children models in allOf clauses (#1127)

* Run ./bin/utils/ensure-up-to-date to re-generate samples run in the CI.

* Fixed issue #1126. DefaultCodegen now sets the hasChildren property of CodegenModel when children models are added to the model. Changed the modelGeneric.mustache template to decide whether to include a base validation model (for children to inherit) based on the hasChildren property, and not the discriminator property.

* Run the ./bin/utils/ensure-up-to-date script after fixing the issue #1126

* Reverted modification in go samples, performed by ./bin/utils/ensure-up-to-date, that are failing in CI.

This partially reverts commit 2168df0f82.
This commit is contained in:
Rubén Martínez
2018-10-15 07:13:05 +02:00
committed by William Cheng
parent 12a702ee07
commit ded765bcb9
4 changed files with 8 additions and 7 deletions

View File

@@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
foreach(var x in BaseValidate(validationContext)) yield return x;
foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;
}
}

View File

@@ -123,7 +123,7 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
foreach(var x in BaseValidate(validationContext)) yield return x;
foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;
}
}