OpenApiDocDescriptor class

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Helper methods for accessing OpenAPI document components.

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Generates OpenAPI v2 (Swagger) documents from C# types decorated with OpenApiSchema attributes.

Methods for applying security schemes to the OpenAPI document.

public class OpenApiDocDescriptor

Public Members

name description
OpenApiDocDescriptor(…) Initializes a new instance of the OpenApiDocDescriptor.
Document { get; } The OpenAPI document being generated.
DocumentId { get; set; } The ID of the OpenAPI document being generated.
HasBeenGenerated { get; } Indicates whether the OpenAPI document has been generated at least once.
Host { get; set; } The Kestrun host providing registered routes.
SecurityRequirement { get; } Security requirements for the OpenAPI document.
ApplySecurityScheme(…) Applies a security scheme to the OpenAPI document based on the provided authentication options.
GenerateComponents() Generates the OpenAPI document by auto-discovering component types.
GenerateDoc() Generates the OpenAPI document by processing components and registered routes.
LoadAnnotatedFunctions(…) Enumerates all in-session PowerShell functions in the given runspace, detects those annotated with [OpenApiPath], and maps them into the provided KestrunHost.
ReadAndDiagnose(…) Reads and diagnoses the OpenAPI document by serializing and re-parsing it.
ToJson(…) Serializes the OpenAPI document to a JSON string.
ToYaml(…) Serializes the OpenAPI document to a YAML string.

See Also