400 Bad Request.
custom mustache template
for the java client
isn’t mapping the
evaluators list.
“Editable fields include: evaluators, expertEvaluator, and scoringIndex”
the generated model
drops the array
during serialization.
tried forcing
the schema type
to List
in the config.
still nothing.
The issue is usually how the generator handles the evaluators array in the request body for PUT /api/v2/quality/calibrations/{calibrationId}. If the mustache template isn’t explicitly handling the collection type, it’ll just null it out during the serialization process.
A common workaround is to bypass the generated model for that specific field and send a raw JSON body. If you’re stuck using the Java client, try overriding the serializer or just use a Map to ensure the array actually hits the wire.
Map<String, Object> body = new HashMap<>();
List<String> evaluatorList = Arrays.asList("user-id-1", "user-id-2");
body.put("evaluators", evaluatorList);
// Use a generic request call instead of the generated model
client.put("/api/v2/quality/calibrations/" + calibrationId, body);
It’s a bit of a pain to do it manually, but it stops the from stripping the data. We’ve seen this happen with other v2 endpoints where the doesn’t quite align with the API spec’s expected array format. Check if the evaluators list is actually populated right before the call, because if it’s empty or null there, the 400 is just the API complaining about the missing required fields.
1 Like
The earlier reply is right. We’re on Zoom Contact Center, and when we map arrays in the ector, it’s easy for the payload to get stripped if the type isn’t a List.
Try checking the JSON body mapping for the PUT /api/v2/quality/calibrations/{calibrationId} call.
{ "evaluators": [ "user1", "user2" ] }
Sometimes the mapping just says null in the logs.
Forget the generator. It’s a known pain with how it handles the evaluators array in the PUT body. Just bypass the model and send a raw JSON string via a generic HTTP client. It’s the only way to stop the from stripping the list. Workaround below.
{
"evaluators": ["user-id-1", "user-id-2"]
}
2 Likes