Shaun Mendham
07/06/2023, 11:06 AM{
"id": "3293bf46-050c-424d-b29f-4dd1de7300f7",
"offerRankings": {
"default": [
"dcc513d2-ffe2-41a4-9b21-0371eb8d120c",
"b3f360d1-d632-406d-83b5-5b27ae029099",
]
}
}
In the above the offerRankings object can have arbitrary keys.
Having looked through the docs found this section, Matching any key in a map
Based on my understanding:
• eachKeyLike can represent an arbitrary key to a string, number, boolean, object ect.
• eachKeyMappedToAnArrayLike can represent an arbitrary key to an array of objects.
Is there anything in the current version which supports an arbitrary key to an array of strings? (or other non object types)
Currently we have this, which works:
var body = newJsonBody(b -> {
b.stringType("id", "c4b86559-1082-4041-a8f5-0175d3f391c9");
b.object("rankings", rankings -> {
rankings.array("default", array -> array.stringType("3fa85f64-5717-4562-b3fc-2c963f66afa5"));
});
}).build();
But this requires a provider to specifically reference the default key.
It feels like this is an edge case, but any feedback on the above is greatly appreciated.uglyog
eachKeyMappedToPrimitiveArrayShaun Mendham
07/11/2023, 8:11 AMuglyog