Skip to content

New-PodeOAStringProperty

SYNOPSIS

Creates a new OpenAPI string property.

SYNTAX

Inbuilt (Default)

New-PodeOAStringProperty [-Name <String>] [-Format <String>] [-Default <String>] [-MinLength <Int32>]
 [-MaxLength <Int32>] [-Pattern <String>] [-Description <String>] [-Enum <String[]>] [-Required] [-Deprecated]
 [-Array] [-Object] [<CommonParameters>]

Custom

New-PodeOAStringProperty [-Name <String>] [-CustomFormat <String>] [-Default <String>] [-MinLength <Int32>]
 [-MaxLength <Int32>] [-Pattern <String>] [-Description <String>] [-Enum <String[]>] [-Required] [-Deprecated]
 [-Array] [-Object] [<CommonParameters>]

DESCRIPTION

Creates a new OpenAPI string property, for Schemas or Parameters.

EXAMPLES

EXAMPLE 1

New-PodeOAStringProperty -Name 'userType' -Default 'admin'

EXAMPLE 2

New-PodeOAStringProperty -Name 'password' -Format Password

PARAMETERS

-Array

If supplied, the string will be treated as an array of strings.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-CustomFormat

The name of a custom OpenAPI Format of the string. (Default: None)

Type: String
Parameter Sets: Custom
Aliases:

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

-Default

The default value of the property. (Default: $null)

Type: String
Parameter Sets: (All)
Aliases:

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

-Deprecated

If supplied, the object will be treated as Deprecated where supported.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Description

A Description of the property.

Type: String
Parameter Sets: (All)
Aliases:

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

-Enum

An optional array of values that this property can only be set to.

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

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

-Format

The inbuilt OpenAPI Format of the string. (Default: Any)

Type: String
Parameter Sets: Inbuilt
Aliases:

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

-MaxLength

The maximum length of the string. (Default: Int.Max)

Type: Int32
Parameter Sets: (All)
Aliases:

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

-MinLength

The minimum length of the string. (Default: Int.Min)

Type: Int32
Parameter Sets: (All)
Aliases:

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

-Name

The Name of the property.

Type: String
Parameter Sets: (All)
Aliases:

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

-Object

If supplied, the string will be automatically wrapped in an object.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Pattern

A Regex pattern that the string must match.

Type: String
Parameter Sets: (All)
Aliases:

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

-Required

If supplied, the object will be treated as Required where supported.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

Back to top