Extracts the JSON schema from an OpenAPI definition.
Export-OpenApiSchema.ps1 [[-Path] <String>] [[-Method] <String>] [[-EndpointPath] <String>]
[[-ResponseStatus] <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Export-OpenApiSchema.ps1 [[-Path] <String>] [[-Method] <String>] [[-EndpointPath] <String>] [-RequestSchema]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Export-OpenApiSchema.ps1 api.json
Returns the schema of the 200 response of any defined endpoint is returned.
Export-OpenApiSchema.ps1 api.json POST /hello -RequestSchema
Returns the schema of the request body of the POST /hello endpoint.
The path to the OpenAPI JSON file.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The HTTP verb of the endpoint to extract the schema from.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: *
Accept pipeline input: False
Accept wildcard characters: False
The HTTP path of the endpoint to extract the schema from.
Type: String
Parameter Sets: (All)
Aliases: ApiPath
Required: False
Position: 3
Default value: *
Accept pipeline input: False
Accept wildcard characters: False
Indicates that the request schema of the endpoint should be returned.
Type: SwitchParameter
Parameter Sets: RequestSchema
Aliases: In
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Indicates the HTTP status code of the response schema of the endpoint that should be returned.
Type: Int32
Parameter Sets: ResponseStatus
Aliases:
Required: False
Position: 4
Default value: 200
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.