brandonchinn178 / aeson-schemas

Easily consume JSON data on-demand with type-safety
http://hackage.haskell.org/package/aeson-schemas
BSD 3-Clause "New" or "Revised" License
53 stars 1 forks source link

Prevent unwrapping past suffix #51

Closed brandon-leapyear closed 4 years ago

brandon-leapyear commented 4 years ago

:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:


We already check that the following is invalid:

[get| o.[x, y].foo |]

We should also be checking it for unwrap:

[unwrap| MySchema.[x, y].foo |]

This PR makes it a parse error instead of manually checking it in the get quasiquoter

codecov-commenter commented 4 years ago

Codecov Report

Merging #51 into master will decrease coverage by 0.18%. The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
- Coverage   87.28%   87.10%   -0.19%     
==========================================
  Files          12       12              
  Lines         464      473       +9     
  Branches       19       21       +2     
==========================================
+ Hits          405      412       +7     
- Misses         51       52       +1     
- Partials        8        9       +1     
Impacted Files Coverage Δ
src/Data/Aeson/Schema/TH/Get.hs 82.97% <62.50%> (-2.13%) :arrow_down:
src/Data/Aeson/Schema/TH/Parse.hs 94.11% <85.71%> (-0.62%) :arrow_down:
src/Data/Aeson/Schema/TH/Schema.hs 92.59% <100.00%> (ø)
src/Data/Aeson/Schema/TH/Unwrap.hs 90.90% <100.00%> (ø)

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 548093b...4a3399f. Read the comment docs.