apicollective / apibuilder

Simple, Comprehensive Tooling for Modern APIs
https://www.apibuilder.io/
MIT License
564 stars 83 forks source link

Apidoc client doesn't work in validation #193

Open Seanstoppable opened 10 years ago

Seanstoppable commented 10 years ago

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.

kscaldef commented 10 years ago

Note: the sbt plugin doesn't work as a result of this issue. https://github.com/gilt/sbt-apidoc/pull/1