Add DualInputDocumentFilter for Swagger content merging
Introduced the `DualInputDocumentFilter` class to merge Swagger operations with the same path but different `[Consumes]` attributes (`multipart/form-data` and `application/json`) into a single operation. This ensures both content types are visible in the Swagger UI. Updated `SwaggerConfiguration.cs` to: - Resolve conflicting actions by keeping the first variant. - Register the `DualInputDocumentFilter` to enable content type merging.
This commit is contained in:
@@ -24,6 +24,13 @@ namespace DocumentOperator.API.Configuration
|
||||
Description = "PDF Verarbeitungs-Service für Validierung, Stempel, Zertifikate, Anhänge & Zusammenführung"
|
||||
});
|
||||
|
||||
// Resolve conflicting actions: Keep first variant
|
||||
// DualInputDocumentFilter will merge both variants into single operation
|
||||
options.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
|
||||
|
||||
// Add document filter to merge operations with different content types
|
||||
options.DocumentFilter<DualInputDocumentFilter>();
|
||||
|
||||
// XML-Kommentare einbinden
|
||||
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
||||
|
||||
Reference in New Issue
Block a user