Intent is to send up a raw document and validate. This works with curling, but not via the apidoc client.
Converting the json string to a JsValue means we are escaping the json, and the server doesn't parse it properly.
I would say that apidoc code generation is not doing the right thing when the body contains a primitive, rather than another object.
Some options:
Don't turn primitives into json values.
Support content-type, so we can specify that and endpoint expects text/plain rather than application/json.
Don't support primitives for body contents.
Change api.json to move back to json -> apijsonbody, and change the server implementation to match.
Intent is to send up a raw document and validate. This works with curling, but not via the apidoc client.
Converting the json string to a JsValue means we are escaping the json, and the server doesn't parse it properly.
I would say that apidoc code generation is not doing the right thing when the body contains a primitive, rather than another object.
Some options:
Don't turn primitives into json values. Support content-type, so we can specify that and endpoint expects text/plain rather than application/json. Don't support primitives for body contents. Change api.json to move back to json -> apijsonbody, and change the server implementation to match.