Skip to content

Commit

Permalink
Add MarkNonNullableReferenceTypesAsRequired to DeepCopy
Browse files Browse the repository at this point in the history
Without this change the setting will not be set when getting
SchemaGeneratorOptions from DI in SchemaGenerator
  • Loading branch information
AntiGuideAkquinet committed Apr 16, 2024
1 parent c0773ce commit f97d834
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private void DeepCopy(SchemaGeneratorOptions source, SchemaGeneratorOptions targ
target.DiscriminatorValueSelector = source.DiscriminatorValueSelector;
target.UseAllOfToExtendReferenceSchemas = source.UseAllOfToExtendReferenceSchemas;
target.SupportNonNullableReferenceTypes = source.SupportNonNullableReferenceTypes;
target.MarkNonNullableReferenceTypesAsRequired = source.MarkNonNullableReferenceTypesAsRequired;
target.SchemaFilters = new List<ISchemaFilter>(source.SchemaFilters);
}

Expand All @@ -50,4 +51,4 @@ private TFilter CreateFilter<TFilter>(FilterDescriptor filterDescriptor)
.CreateInstance(_serviceProvider, filterDescriptor.Type, filterDescriptor.Arguments);
}
}
}
}

0 comments on commit f97d834

Please sign in to comment.