2020using Microsoft . Extensions . DependencyInjection ;
2121using Microsoft . Extensions . Hosting ;
2222using Microsoft . Extensions . Options ;
23- using Microsoft . OpenApi . Any ;
2423using Microsoft . OpenApi . Models ;
2524
2625namespace Microsoft . AspNetCore . OpenApi ;
@@ -34,7 +33,6 @@ internal sealed class OpenApiDocumentService(
3433{
3534 private readonly OpenApiOptions _options = optionsMonitor . Get ( documentName ) ;
3635 private readonly OpenApiSchemaService _componentService = serviceProvider . GetRequiredKeyedService < OpenApiSchemaService > ( documentName ) ;
37- private readonly IOpenApiDocumentTransformer _scrubExtensionsTransformer = new ScrubExtensionsTransformer ( ) ;
3836 private readonly IOpenApiDocumentTransformer _schemaReferenceTransformer = new OpenApiSchemaReferenceTransformer ( ) ;
3937
4038 private static readonly OpenApiEncoding _defaultFormEncoding = new OpenApiEncoding { Style = ParameterStyle . Form , Explode = true } ;
@@ -82,8 +80,6 @@ private async Task ApplyTransformersAsync(OpenApiDocument document, Cancellation
8280 }
8381 // Move duplicated JSON schemas to the global components.schemas object and map references after all transformers have run.
8482 await _schemaReferenceTransformer . TransformAsync ( document , documentTransformerContext , cancellationToken ) ;
85- // Remove `x-aspnetcore-id` and `x-schema-id` extensions from operations after all transformers have run.
86- await _scrubExtensionsTransformer . TransformAsync ( document , documentTransformerContext , cancellationToken ) ;
8783 }
8884
8985 // Note: Internal for testing.
@@ -126,7 +122,7 @@ private async Task<Dictionary<OperationType, OpenApiOperation>> GetOperationsAsy
126122 foreach ( var description in descriptions )
127123 {
128124 var operation = await GetOperationAsync ( description , capturedTags , cancellationToken ) ;
129- operation . Extensions . Add ( OpenApiConstants . DescriptionId , new OpenApiString ( description . ActionDescriptor . Id ) ) ;
125+ operation . Extensions . Add ( OpenApiConstants . DescriptionId , new ScrubbedOpenApiAny ( description . ActionDescriptor . Id ) ) ;
130126 _operationTransformerContextCache . TryAdd ( description . ActionDescriptor . Id , new OpenApiOperationTransformerContext
131127 {
132128 DocumentName = documentName ,
0 commit comments