Skip to content

Commit

Permalink
Fixed missing parenthesis that could cause a property to be added as …
Browse files Browse the repository at this point in the history
…required multiple times.
  • Loading branch information
Eneuman committed Mar 11, 2021
1 parent a712296 commit adb9352
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 adb9352

Please sign in to comment.