-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Request was malformed' on POST, error is hard to track down in the code #41
Comments
OK so if I had remembered to check the nodemon output, I would've found the stack trace a lot sooner (duh). Closing this because the error isn't hard to find, really. Related: The way Fortune requires POST requests to be formatted is really strange and unintuitive to me, but it looks like that's hwo the json-api.org format is set up. Reference: json-api/json-api#131 |
Yep, the format is somewhat unwieldy. Actually I was thinking of relaxing this requirement of wrapping the posted resource if it is singular, but I'm not sure what @steveklabnik would think. |
We actually also break this rule at Balanced right now. I like the 'always multiple' because it simplifies processing. I think it's a semi-ambiguous part of the spec, but I'd like for it to be not so. |
It seems the spec changed and now single objects are a must: http://jsonapi.org/format/#crud-creating-individual-resources |
@cgrossde currently doing a rewrite of the entire thing, decoupling fortune from specific formats such as JSON API, but it will still be supported as the default format. Seems like there are breaking changes due to the spec changing, so I'd like to distance those problems from this package. |
Just trying to get fortune up and running with a simple test, with this:
Which is working fine listening, and /books returns
{ "books": [ ] }
as expected. But when I try to POST to create a new book, like this:I get the following, somewhat unspecific error.
Thanks!
The text was updated successfully, but these errors were encountered: