@@ -425,7 +425,8 @@ public static IDictionary<string, OpenApiSchema> CreateStructuredTypePropertiesS
425425 {
426426 OpenApiSchema propertySchema = context . CreatePropertySchema ( property , document ) ;
427427 propertySchema . Description = context . Model . GetDescriptionAnnotation ( property ) ;
428- propertySchema . Extensions ??= new Dictionary < string , IOpenApiExtension > ( ) ;
428+ // we always want a new copy because it's a reference
429+ propertySchema . Extensions = propertySchema . Extensions is null ? [ ] : new Dictionary < string , IOpenApiExtension > ( propertySchema . Extensions ) ;
429430 propertySchema . Extensions . AddCustomAttributesToExtensions ( context , property ) ;
430431 properties . Add ( property . Name , propertySchema ) ;
431432 }
@@ -435,7 +436,8 @@ public static IDictionary<string, OpenApiSchema> CreateStructuredTypePropertiesS
435436 {
436437 OpenApiSchema propertySchema = context . CreateEdmTypeSchema ( property . Type , document ) ;
437438 propertySchema . Description = context . Model . GetDescriptionAnnotation ( property ) ;
438- propertySchema . Extensions ??= new Dictionary < string , IOpenApiExtension > ( ) ;
439+ // we always want a new copy because it's a reference
440+ propertySchema . Extensions = propertySchema . Extensions is null ? [ ] : new Dictionary < string , IOpenApiExtension > ( propertySchema . Extensions ) ;
439441 propertySchema . Extensions . AddCustomAttributesToExtensions ( context , property ) ;
440442 propertySchema . Extensions . Add ( Constants . xMsNavigationProperty , new OpenApiAny ( true ) ) ;
441443 properties . Add ( property . Name , propertySchema ) ;
0 commit comments