Hi,
Is it possible to define a mandatory parameter for an API endpoint?
For example a parameter named ID.
Thanks!
Like this?
docs.powershelluniversal.com
New-PSUEndpoint -Url '/user' -Method Post -Endpoint {
param([Parameter(Mandatory)]$userName, $FirstName, $LastName)
New-User $UserName -FirstName $FirstName -LastName $LastName
}@AnonymousUser the following code I’ve already added. But it doesn’t work.
The “Required” flag isn’t vissible in the SwaggerUI documentation.
Param (
[Parameter(Mandatory)] $Id
)