jsonapi-rb / jsonapi-parser

Validate JSON API documents.
http://jsonapi-rb.org
MIT License
27 stars 10 forks source link

Only validate that `data` key is present #4

Closed poteto closed 7 years ago

poteto commented 7 years ago

If a JSON-API document contains included relationships, the parser throws an error. This PR addresses it by only checking for the presence of the data top level key.

codecov-io commented 7 years ago

Codecov Report

Merging #4 into master will increase coverage by 1.68%.

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
+ Coverage   80.67%   82.35%   +1.68%     
==========================================
  Files           5        5              
  Lines         119      119              
==========================================
+ Hits           96       98       +2     
+ Misses         23       21       -2
Impacted Files Coverage Δ
lib/jsonapi/parser/resource.rb 62.5% <ø> (ø) :white_check_mark:
lib/jsonapi/parser/document.rb 85.39% <ø> (+2.24%) :white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 63ba439...25a6ee1. Read the comment docs.

beauby commented 7 years ago

Hi @poteto – sorry for the late reply. As I understand it, the spec does not currently allow compound documents as incoming payloads. Could you elaborate on your use-case?

beauby commented 7 years ago

Hi @poteto – I believe this is solved now. Feel free to reopen if needed!