Skip to content

Commit

Permalink
Merge pull request #2054 from Eneuman/master
Browse files Browse the repository at this point in the history
Fixed missing parenthesis that could cause a property to be added as required multiple times.
  • Loading branch information
domaindrivendev authored Mar 11, 2021
2 parents a712296 + adb9352 commit 68d7ef8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ private OpenApiSchema CreateObjectSchema(DataContract dataContract, SchemaReposi
? GenerateSchemaForMember(dataProperty.MemberInfo, schemaRepository, dataProperty)
: GenerateSchemaForType(dataProperty.MemberType, schemaRepository);

if (dataProperty.IsRequired || customAttributes.OfType<RequiredAttribute>().Any()
if ((dataProperty.IsRequired || customAttributes.OfType<RequiredAttribute>().Any())
&& !schema.Required.Contains(dataProperty.Name))
{
schema.Required.Add(dataProperty.Name);
Expand Down

0 comments on commit 68d7ef8

Please sign in to comment.