5 ms·
I may be weird but I do it like this: { "type": "a", "version": "1", "payloadJson": "{\"a\": 10}" }
by jurschreuder 4y ago
I may be weird but I do it like this:
{
"type": "a",
"version": "1",
"payloadJson": "{\"a\": 10}"
}
- __ryan__ 4y agoWhy?
- Otek 4y agoThat is kinda weird, why would you store json in a json as a string?
- arinlen 4y ago> { "type": "a", "version": "1", "payloadJson": "{\"a\": 10}" } What's wrong with REST and leaving stuff like versioning and resource type to HATEOAS?
- selfhoster11 4y agoIt is weird. There aren't many reasons that I can think of for encoding things this way.
- remram 4y agoIt sounds like you are reinventing HTTP headers and trying to put them in the body for whatever reason. I've also seen this before, but I can't say I didn't laugh: HTTP/1.1 200 Ok Content-type: application/json {"status": 404, "type": "xml", "body": "<entry><name>...</name><author>...</author></entry>"}