Open bitsoflogic opened 8 years ago
So I decided to dive into the code a bit and it looks like this may actually fall into a decision on your jsonapi-server
package instead. I mistakenly assumed the validation was happening on this side.
In lib\routes\helper.js
, adding a presence: 'required'
param appears to make this work as I expected however at this point I don't know what/if-any adverse effects this may have on the implementation of the JSONAPI 1.0 spec. The change produces a 403 if I submit a POST without the roles param.
Joi.validate(someObject, someDefinition, { abortEarly: false, presence: 'required' }, function (err, sanitisedObject) {
Hi @bitsoflogic. Thank you for your report. You are right that this a jsonapi-server
issue rather than a relational database store issue. Can you please move this issue there, where we will be able to better address it?
Debugging (with handler logging through
bunyan
):The `server.metrics.on('data'):
The server never responds with the ID according to Ember Inspector (I'm guessing the data key is empty).
Attempts to query the new ID directly fail as well, which was the reason for #36.
Looking through the docs, I think this should return a
403 Forbidden
(http://jsonapi.org/format/#crud-creating-responses-403).To replicate this issue, this is the Ember.js code (roles is completely missing from the create POST):
On the server: