Problem creating an Organisation with metadata

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

After a bit of digging, I see that the metadata value is only accepted if it is a String. If I want to contain my json within a string, does anyone know what the metadata value string length maximum is?

Strange that the Management API Java SDK defines the metadata field in the Organization class as,

    private Map<String, Object> metadata;

So this should probalby change to a Map<String, String> or the restriction be lifted ??