I’m using groovy with the Java Management API SDK. When I try and create an Organization with metadata I get a 400 response with,
{"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'Expected type string,null but found type array' on property metadata.retailChannels.","errorCode":"invalid_body"}
When I debug into the SDK, I can see the request is set up content-type as ‘application/json’ and the json within the body looks ok,
{
"name": "conglomerated_aggregates",
"display_name": "Conglomerated Aggregates",
"metadata": {
"retailChannels": [
{
"name": "aggregates",
"merchantId": "77AF82A5-E825-40C0-BA5D-45C59D7EE458"
},
{
"name": "conglomerates",
"merchantId": "7A9555F6-B686-49B1-964A-A87654FCDF3B"
}
]
}
}
If I go to the auth0 Dashboard and manually add the equivalent as a metadata value, ie
[ { "name": "aggregates", "merchantId": "77AF82A5-E825-40C0-BA5D-45C59D7EE458" }, { "name": "conglomerates", "merchantId": "7A9555F6-B686-49B1-964A-A87654FCDF3B" } ]
as a value then it is added ok.
Any suggestions? As implied above, I’m using the Java Managem,ent SDK to build and execute the http request