on 04-12-2022 9:00 PM
Hi,
is it possible to model a generic key: value
Object-like type in a .cds
with a dynamic key name?
à la TypeScript Record<String, String>
So e.g. a modeled action
action bla(id: String, variables: array of Record<String,String>);
could be called with the payload
POST http://localhost:4004/bla
Content-Type: application/json
{
"id": "4711",
"variables": [
{"i": "hope"},
{"this": "is"},
{"possible": "isit?"}
]
}
No, this is not possible.
The best you can do currently is to model "variables" as String or "array of String", with the (implicit) extra knowledge that the content of this String is a JSON of a certain form.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.