danivek/json-api-serializer

Acceptance of malformed relationships

chamini2 opened this issue · 2 comments

I noticed that in 62b7386 you are handling malformed relationships by ignoring them. This seems to me a debatable thing to do, since maybe we should be warning the user of the malformed data, rather than ignoring it.

I don't ask for us to check if it's malformed and throw on it, what I would suggest is not check for this at all. JSON API specifies a very clear payload format, so if it is not followed, it's understandable that this package would not work correctly.

What I am trying to say is, why not make the code easier to maintain by accounting for less cases? Maybe I can remove this specific check in #48.

I accepted your PR too fast...

I totally agree with you. The best thing to do here is to remove this specific check.

Great, @danivek, I left a comment: 4662768#r27962123