New-PodeOARequestBody
SYNOPSIS
Creates a Request Body definition for routes.
SYNTAX
Schema (Default)
New-PodeOARequestBody -ContentSchemas <Hashtable> [-Description <String>] [-Required] [<CommonParameters>]
Reference
New-PodeOARequestBody -Reference <String> [<CommonParameters>]
DESCRIPTION
Creates a Request Body definition for routes from the supplied content-types and schemas.
EXAMPLES
EXAMPLE 1
New-PodeOARequestBody -ContentSchemas @{ 'application/json' = (New-PodeOAIntProperty -Name 'userId' -Object) }
EXAMPLE 2
New-PodeOARequestBody -ContentSchemas @{ 'application/json' = 'UserIdSchema' }
EXAMPLE 3
New-PodeOARequestBody -Reference 'UserIdBody'
PARAMETERS
-ContentSchemas
The content-types and schema the request body accepts (the schema is created using the Property functions).
Type: Hashtable
Parameter Sets: Schema
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Description
A Description of the request body.
Type: String
Parameter Sets: Schema
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Reference
A reference name from an existing component request body.
Type: String
Parameter Sets: Reference
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Required
If supplied, the request body will be flagged as required.
Type: SwitchParameter
Parameter Sets: Schema
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.