Skip to content

Enable-PodeOpenApi

SYNOPSIS

Enables the OpenAPI default route in Pode.

SYNTAX

Enable-PodeOpenApi [[-Path] <String>] [-Title] <String> [[-Version] <String>] [[-Description] <String>]
 [[-RouteFilter] <String>] [[-Middleware] <Object[]>] [-RestrictRoutes] [<CommonParameters>]

DESCRIPTION

Enables the OpenAPI default route in Pode, as well as setting up details like Title and API Version.

EXAMPLES

EXAMPLE 1

Enable-PodeOpenApi -Title 'My API' -Version '1.0.0' -RouteFilter '/api/*'

EXAMPLE 2

Enable-PodeOpenApi -Title 'My API' -Version '1.0.0' -RouteFilter '/api/*' -RestrictRoutes

EXAMPLE 3

Enable-PodeOpenApi -Path '/docs/openapi' -Title 'My API' -Version '1.0.0'

PARAMETERS

-Description

A Description of the API.

Type: String
Parameter Sets: (All)
Aliases:

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

-Middleware

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

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

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

-Path

An optional custom route path to access the OpenAPI definition. (Default: /openapi)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: /openapi
Accept pipeline input: False
Accept wildcard characters: False

-RestrictRoutes

If supplied, only routes that are available on the Requests URI will be used to generate the OpenAPI definition.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-RouteFilter

An optional route filter for routes that should be included in the definition. (Default: /*)

Type: String
Parameter Sets: (All)
Aliases:

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

-Title

The Title of the API.

Type: String
Parameter Sets: (All)
Aliases:

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

-Version

The Version of the API. (Default: 0.0.0)

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: 0.0.0
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