Skip to content

Enable-PodeOpenApiViewer

SYNOPSIS

Adds a route that enables a viewer to display OpenAPI docs, such as Swagger or ReDoc.

SYNTAX

Enable-PodeOpenApiViewer [-Type] <String> [[-Path] <String>] [[-OpenApiUrl] <String>]
 [[-Middleware] <Object[]>] [[-Title] <String>] [-DarkMode] [<CommonParameters>]

DESCRIPTION

Adds a route that enables a viewer to display OpenAPI docs, such as Swagger or ReDoc.

EXAMPLES

EXAMPLE 1

Enable-PodeOpenApiViewer -Type Swagger -DarkMode

EXAMPLE 2

Enable-PodeOpenApiViewer -Type ReDoc -Title 'Some Title' -OpenApi 'http://some-url/openapi'

PARAMETERS

-DarkMode

If supplied, the page will be rendered using a dark theme (this is not supported for all viewers).

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Middleware

Like normal Routes, an array of Middleware that will be applied.

Type: Object[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OpenApiUrl

The URL where the OpenAPI definition can be retrieved. (Default is the OpenAPI path from Enable-PodeOpenApi)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

The route Path where the docs can be accessed. (Default: "/$Type")

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Title

The title of the web page.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Type

The Type of OpenAPI viewer to use.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES