@@ -413,7 +413,7 @@ internal void WriteJsonSchemaKeywords(IOpenApiWriter writer)
413413 internal void WriteAsItemsProperties ( IOpenApiWriter writer )
414414 {
415415 // type
416- writer . WriteProperty ( OpenApiConstants . Type , ( Type & ~ JsonSchemaType . Null ) . ToIdentifier ( ) ? . FirstOrDefault ( ) ) ;
416+ writer . WriteProperty ( OpenApiConstants . Type , ( Type & ~ JsonSchemaType . Null ) ? . FirstIdentifier ( ) ) ;
417417
418418 // format
419419 WriteFormatProperty ( writer ) ;
@@ -651,14 +651,14 @@ Extensions is not null &&
651651 break ;
652652 case OpenApiSpecVersion . OpenApi3_0 when isNullable && type . Value == JsonSchemaType . Null :
653653 writer . WriteProperty ( OpenApiConstants . Nullable , true ) ;
654- writer . WriteProperty ( OpenApiConstants . Type , JsonSchemaType . Object . ToIdentifier ( ) . FirstOrDefault ( ) ) ;
654+ writer . WriteProperty ( OpenApiConstants . Type , JsonSchemaType . Object . FirstIdentifier ( ) ) ;
655655 break ;
656656 case OpenApiSpecVersion . OpenApi3_0 when isNullable && type . Value != JsonSchemaType . Null :
657657 writer . WriteProperty ( OpenApiConstants . Nullable , true ) ;
658- writer . WriteProperty ( OpenApiConstants . Type , type . Value . ToIdentifier ( ) . FirstOrDefault ( ) ) ;
658+ writer . WriteProperty ( OpenApiConstants . Type , type . Value . FirstIdentifier ( ) ) ;
659659 break ;
660660 default :
661- writer . WriteProperty ( OpenApiConstants . Type , type . Value . ToIdentifier ( ) . FirstOrDefault ( ) ) ;
661+ writer . WriteProperty ( OpenApiConstants . Type , type . Value . FirstIdentifier ( ) ) ;
662662 break ;
663663 }
664664 }
@@ -703,7 +703,7 @@ private static void UpCastSchemaTypeToV31(JsonSchemaType type, IOpenApiWriter wr
703703 var temporaryType = type | JsonSchemaType . Null ;
704704 var list = ( from JsonSchemaType flag in jsonSchemaTypeValues // Check if the flag is set in 'type' using a bitwise AND operation
705705 where temporaryType . HasFlag ( flag )
706- select flag . ToIdentifier ( ) . FirstOrDefault ( ) ) . ToList ( ) ;
706+ select flag . FirstIdentifier ( ) ) . ToList ( ) ;
707707 if ( list . Count > 1 )
708708 {
709709 writer . WriteOptionalCollection ( OpenApiConstants . Type , list , ( w , s ) => w . WriteValue ( s ) ) ;
@@ -740,7 +740,7 @@ private void DowncastTypeArrayToV2OrV3(JsonSchemaType schemaType, IOpenApiWriter
740740 if ( schemaType . HasFlag ( flag ) && flag != JsonSchemaType . Null )
741741 {
742742 // Write the non-null flag value to the writer
743- writer . WriteProperty ( OpenApiConstants . Type , flag . ToIdentifier ( ) . FirstOrDefault ( ) ) ;
743+ writer . WriteProperty ( OpenApiConstants . Type , flag . FirstIdentifier ( ) ) ;
744744 }
745745 }
746746 writer . WriteProperty ( nullableProp , true ) ;
@@ -753,7 +753,7 @@ private void DowncastTypeArrayToV2OrV3(JsonSchemaType schemaType, IOpenApiWriter
753753 }
754754 else
755755 {
756- writer . WriteProperty ( OpenApiConstants . Type , schemaType . ToIdentifier ( ) . FirstOrDefault ( ) ) ;
756+ writer . WriteProperty ( OpenApiConstants . Type , schemaType . FirstIdentifier ( ) ) ;
757757 }
758758 }
759759 }
0 commit comments