POST Endpoints - Nested Payload Errors

Version PSU - DOCKER - Ubuntu - 3.3.5

Hello Here,

I’m trying to post a payload that looks like:

{
“a”: {
“d2”: “d2”,
“d1”: “d1”
}
}

and my endpoint is the following:

[CmdletBinding()]
param (
    [Parameter(Mandatory = $true, Position = 0)]
    $a
)

$a

when I try to query this endpoint I’m facing the following error :

Invoke-RestMethod: Cannot process command because of one or more missing mandatory parameters: a.
at , : line 1

if I’m simply converting the body like :

$vars = $body | convertfrom-JSON
$vars.a

it works

Does anyone has faced this issue ?

@adam do you have any idea ?

many thanks in advance and regards

I can reproduce this. I’ll open an enhancement to get this working.