Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix top-level resource optional id & add test cases for type/id requirements #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nruth
Copy link

@nruth nruth commented Aug 9, 2018

on client requesting to create a resource on the server

This happened after seeing jsonapi-rb/jsonapi-deserializable#21 and trying to figure out whether I can use that or not (after having false starts with a lot of ruby json-api libraries).

The code was already structured to handle the optional top-level id, it just seems be wired up wrong and was missing a test case. This will need a review as I'm not 100% sure of what the spec says, especially about the case where the top-level is an array of resource objects rather than a single one. I think this makes sense, but it might be wrong.

on client requesting to create a resource on the server
@codecov-io
Copy link

codecov-io commented Aug 9, 2018

Codecov Report

Merging #13 into master will increase coverage by 0.84%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage   80.67%   81.51%   +0.84%     
==========================================
  Files           5        5              
  Lines         119      119              
==========================================
+ Hits           96       97       +1     
+ Misses         23       22       -1
Impacted Files Coverage Δ
lib/jsonapi/parser/document.rb 84.26% <100%> (+1.12%) ⬆️

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 1ab3d35...4625478. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants