Class UserAgentDocumentFilter
- Namespace
- Codebelt.Extensions.Swashbuckle.AspNetCore
- Assembly
- Codebelt.Extensions.Swashbuckle.AspNetCore.dll
Provides a User-Agent field to the generated OpenApiDocument.
public class UserAgentDocumentFilter : DocumentFilter<UserAgentDocumentOptions>, IDocumentFilter, IConfigurable<UserAgentDocumentOptions>
- Inheritance
-
UserAgentDocumentFilter
- Implements
- Inherited Members
Remarks
Inspiration for this class was borrowed from: https://github.com/tgstation/tgstation-server/blob/dev/src/Tgstation.Server.Host/Core/SwaggerConfiguration.cs
Constructors
UserAgentDocumentFilter(UserAgentDocumentOptions)
Initializes a new instance of the UserAgentDocumentFilter class.
public UserAgentDocumentFilter(UserAgentDocumentOptions options)
Parameters
options
UserAgentDocumentOptionsThe configured options of this instance.
Methods
Apply(OpenApiDocument, DocumentFilterContext)
Applies post-processing to the swaggerDoc
.
public override void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
Parameters
swaggerDoc
OpenApiDocumentThe OpenApiDocument to modify.
context
DocumentFilterContextThe DocumentFilterContext that provides additional context.
Remarks
Once an OpenApiDocument has been generated you have full control to modify the document however you see fit.