Daniel Tischner
08/12/2022, 1:15 PMbody(newJsonObject {
newArray("value_added_taxes") {
eachLike {
integerType("id")
newArray("values") {
decimalType("rate")
datetime("valid_since") // "2020-04-15T17:30:00Z"
datetime("valid_until") // "2020-06-15T17:30:00Z"
}
}
}
})
https://i.imgur.com/mLhIT5Y.png▾
https://i.imgur.com/yNrfnCS.png▾
{
"value_added_taxes": [
{
"id": 0,
"values": [
"rate": 0.12,
"valid_since": "2020-04-15T17:30:00Z",
"valid_until": "2020-06-15T17:30:00Z"
]
}
]
}
Boris
08/14/2022, 7:29 AMdatetime
example over in the other thread 🙂 it's a bit fiddly to get things working as DSL out of the gate, I mostly got those helpers from making them work manually, then extracting them out.Daniel Tischner
08/22/2022, 8:21 AMDaniel Tischner
08/22/2022, 8:21 AMDaniel Tischner
08/22/2022, 9:12 AMeachLike
is already an array. so
newArray("foo") {
eachLike {
...
}
}
should just be:
eachLike("foo") {
...
}
and 2. i was mixing up all the implicit this
and explicit `it`s, ultimately adding to the wrong object