jbuilder-json_api icon indicating copy to clipboard operation
jbuilder-json_api copied to clipboard

invalid json-api code is generated

Open hleonov opened this issue 8 years ago • 0 comments

First of all, thanks for this gem! will definitely make life a bit easier.

Second, using a json-api validator: https://www.npmjs.com/package/jsonapi-validator I found that the generated code is invalid due to two reasons:

  1. the 'id' attribute is written as a number, not a string. A matter of a simple "to_s" in the code
  2. null attributes are also not strings. so either they are not written at all, or stringified as "null".

hleonov avatar Feb 23 '17 15:02 hleonov