@@ -133,7 +133,7 @@ public class OpenApiSchema : IOpenApiSerializable, IOpenApiReferenceable, IOpenA
133133 /// <summary>
134134 /// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
135135 /// </summary>
136- public IList < string > Required { get ; set ; } = new List < string > ( ) ;
136+ public ISet < string > Required { get ; set ; } = new HashSet < string > ( ) ;
137137
138138 /// <summary>
139139 /// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
@@ -393,7 +393,7 @@ public void SerializeAsV3WithoutReference(IOpenApiWriter writer)
393393 /// </summary>
394394 public void SerializeAsV2 ( IOpenApiWriter writer )
395395 {
396- SerializeAsV2 ( writer : writer , parentRequiredProperties : new List < string > ( ) , propertyName : null ) ;
396+ SerializeAsV2 ( writer : writer , parentRequiredProperties : new HashSet < string > ( ) , propertyName : null ) ;
397397 }
398398
399399 /// <summary>
@@ -403,7 +403,7 @@ public void SerializeAsV2WithoutReference(IOpenApiWriter writer)
403403 {
404404 SerializeAsV2WithoutReference (
405405 writer : writer ,
406- parentRequiredProperties : new List < string > ( ) ,
406+ parentRequiredProperties : new HashSet < string > ( ) ,
407407 propertyName : null ) ;
408408 }
409409
@@ -416,7 +416,7 @@ public void SerializeAsV2WithoutReference(IOpenApiWriter writer)
416416 /// <param name="propertyName">The property name that will be serialized.</param>
417417 internal void SerializeAsV2 (
418418 IOpenApiWriter writer ,
419- IList < string > parentRequiredProperties ,
419+ ISet < string > parentRequiredProperties ,
420420 string propertyName )
421421 {
422422 if ( writer == null )
@@ -432,7 +432,7 @@ internal void SerializeAsV2(
432432
433433 if ( parentRequiredProperties == null )
434434 {
435- parentRequiredProperties = new List < string > ( ) ;
435+ parentRequiredProperties = new HashSet < string > ( ) ;
436436 }
437437
438438 SerializeAsV2WithoutReference ( writer , parentRequiredProperties , propertyName ) ;
@@ -447,7 +447,7 @@ internal void SerializeAsV2(
447447 /// <param name="propertyName">The property name that will be serialized.</param>
448448 internal void SerializeAsV2WithoutReference (
449449 IOpenApiWriter writer ,
450- IList < string > parentRequiredProperties ,
450+ ISet < string > parentRequiredProperties ,
451451 string propertyName )
452452 {
453453 writer . WriteStartObject ( ) ;
@@ -521,7 +521,7 @@ internal void WriteAsItemsProperties(IOpenApiWriter writer)
521521
522522 internal void WriteAsSchemaProperties (
523523 IOpenApiWriter writer ,
524- IList < string > parentRequiredProperties ,
524+ ISet < string > parentRequiredProperties ,
525525 string propertyName )
526526 {
527527 if ( writer == null )
0 commit comments