jsonapi-suite / jsonapi_errorable

MIT License
8 stars 15 forks source link

Error on model/base does not to work with ember-data #22

Open onumossn opened 6 years ago

onumossn commented 6 years ago

Since ember-data seems to expect source/pointer to be "data/attributes/base" for errors on the model which aren't specific to a model attribute (https://github.com/emberjs/data/blob/v3.5.0/addon/-private/adapters/errors.js#L446) and https://github.com/jsonapi-suite/jsonapi_errorable/pull/13/files#diff-464e7d878a98e6a985d3f83118db6c98R97 started setting source/pointer to nil. The error on returned from the api can no longer be found on the ember-data model. Why was this change made? Can it be undone or made an option?

leondmello commented 5 years ago

@richmolj any comments about this one ?

richmolj commented 5 years ago

I'm up for rendering a source/pointer in this case specifically to support ember-data; I'd merge a PR.

That said, seems more like ember-data issue than anything else. It seems ember-data doesn't support the concept of validation errors that are not on an attribute - if we did data/attributes/base, we're saying "there is an attribute called base that has an error", which is not actually the case.

So I'd merge a fix to accommodate real-life, but note that fix would be an annoying hack.