-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
When I attempt to make a verify request like so:
VerifyRequest request = new VerifyRequest(recipient);
request.setType(VerifyType.TTS);
request.setLanguage(Language.DE_DE);
request.setOriginator(originator);
client.sendVerifyToken(request);I get back a 422 with
Language must be one of: cy-gb, da-dk, de-de, el-gr, en-au, en-gb, en-in, en-us, es-es, es-mx, es-us, fr-ca, fr-fr, id-id, is-is, it-it, ja-jp, ko-kr, ms-my, nb-no, nl-nl, pl-pl, pt-br, pt-pt, ro-ro, ru-ru, sv-se, ta-in, th-th, tr-tr, vi-vn, zh-cn, zh-hk.
The serialized json request that ends up getting sent to the server is:
{
"recipient": "redacted",
"originator": "redacted",
"type": "tts",
"datacoding": "DataCoding{value=plain}",
"language": "DE_DE"
}
It looks like the ObjectMapper being used is using default enum serialization. The Language enum does have correctly cased toString.
One way to fix this might be to enable toString serialization for enums in the ObjectMapper
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
but this may have other effects.
Two other notes:
- the code tag for
RU_RUisru_rubut the API docs indicate it should beru-ru - I only see this problem for
tts, forsmsverify it seems like the server completely ignores the language tag, unsure if that's a separate (upstream) issue.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels