Skip to content

Commit b8ebc1a

Browse files
Copilotwadepickett
andcommitted
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 <[email protected]>
1 parent 329ffc7 commit b8ebc1a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

aspnetcore/fundamentals/openapi/using-openapi-documents.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use OpenAPI documents in an ASP.NET Core app.
55
ms.author: safia
66
monikerRange: '>= aspnetcore-6.0'
77
ms.custom: mvc
8-
ms.date: 08/04/2025
8+
ms.date: 12/04/2025
99
uid: fundamentals/openapi/using-openapi-documents
1010
---
1111
# Use openAPI documents
@@ -105,11 +105,11 @@ The output shows any issues with the OpenAPI document. For example:
105105
You can inject <xref:Microsoft.AspNetCore.OpenApi.IOpenApiDocumentProvider> into your services through dependency injection to access OpenAPI documents programmatically, even outside HTTP request contexts.
106106

107107
```csharp
108-
public class DocumentService
108+
public class CustomDocumentService
109109
{
110110
private readonly IOpenApiDocumentProvider _documentProvider;
111111

112-
public DocumentService(IOpenApiDocumentProvider documentProvider)
112+
public CustomDocumentService(IOpenApiDocumentProvider documentProvider)
113113
{
114114
_documentProvider = documentProvider;
115115
}
@@ -124,7 +124,7 @@ public class DocumentService
124124
Register the service in your DI container:
125125

126126
```csharp
127-
builder.Services.AddScoped<DocumentService>();
127+
builder.Services.AddScoped<CustomDocumentService>();
128128
```
129129

130130
This enables scenarios such as generating client SDKs, validating API contracts in background processes, or exporting documents to external systems.

0 commit comments

Comments
 (0)