From 329ffc757eed0aaf3200e9dbc24ef8523812c9ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 21:41:58 +0000 Subject: [PATCH 1/2] Initial plan From b8ebc1a1a3a14ecf829ae32c9b4813d51566308e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 21:45:31 +0000 Subject: [PATCH 2/2] Rename DocumentService to CustomDocumentService in sample code Fixes #36433 - Clarifies that the sample class is a user-defined service to prevent confusion with internal framework types like OpenApiDocumentService. Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> --- .../fundamentals/openapi/using-openapi-documents.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/fundamentals/openapi/using-openapi-documents.md b/aspnetcore/fundamentals/openapi/using-openapi-documents.md index b07ab2643cba..b592b874689d 100644 --- a/aspnetcore/fundamentals/openapi/using-openapi-documents.md +++ b/aspnetcore/fundamentals/openapi/using-openapi-documents.md @@ -5,7 +5,7 @@ description: Learn how to use OpenAPI documents in an ASP.NET Core app. ms.author: safia monikerRange: '>= aspnetcore-6.0' ms.custom: mvc -ms.date: 08/04/2025 +ms.date: 12/04/2025 uid: fundamentals/openapi/using-openapi-documents --- # Use openAPI documents @@ -105,11 +105,11 @@ The output shows any issues with the OpenAPI document. For example: You can inject into your services through dependency injection to access OpenAPI documents programmatically, even outside HTTP request contexts. ```csharp -public class DocumentService +public class CustomDocumentService { private readonly IOpenApiDocumentProvider _documentProvider; - public DocumentService(IOpenApiDocumentProvider documentProvider) + public CustomDocumentService(IOpenApiDocumentProvider documentProvider) { _documentProvider = documentProvider; } @@ -124,7 +124,7 @@ public class DocumentService Register the service in your DI container: ```csharp -builder.Services.AddScoped(); +builder.Services.AddScoped(); ``` This enables scenarios such as generating client SDKs, validating API contracts in background processes, or exporting documents to external systems.