Skip to content

New-PodeJsonSchemaArray

SYNOPSIS

Creates an Array JSON Schema type definition.

SYNTAX

New-PodeJsonSchemaArray -Item <Hashtable> [-MinItems <Int32>] [-MaxItems <Int32>] [-Description <String>]
 [-Unique] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This function creates a JSON Schema type definition for an Array type.

EXAMPLES

EXAMPLE 1

# create a JSON Schema definition for an array of strings
New-PodeJsonSchemaArray -Item (New-PodeJsonSchemaString)

EXAMPLE 2

# create a JSON Schema definition for an array of integers with at least 1 item and at most 5 items
New-PodeJsonSchemaArray -Item (New-PodeJsonSchemaInteger) -MinItems 1 -MaxItems 5

EXAMPLE 3

# create a JSON Schema definition for an array of unique strings with a description
New-PodeJsonSchemaArray -Item (New-PodeJsonSchemaString) -Unique

PARAMETERS

-Description

An optional Description.

Type: String
Parameter Sets: (All)
Aliases:

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

-Item

A hashtable representing the JSON Schema type definition for the items in the array.

Type: Hashtable
Parameter Sets: (All)
Aliases:

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

-MaxItems

An optional maximum number of items in the array.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-MinItems

An optional minimum number of items in the array.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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

-Unique

An optional switch to indicate if the items in the array must be unique.

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

System.Collections.Hashtable

NOTES