-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Allow aeson-2.2 #1695
Merged
Merged
Allow aeson-2.2 #1695
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ce45c8e
Allow aeson-2.2
maksbotan 96aa9d9
fail-fast: false for github actions
maksbotan 97dba02
Get rid of eitherDecodeLenient
maksbotan d074bba
Run CI on push only to master
maksbotan b9da2f3
Return eitherDecodeLenient as deprecated synonym
maksbotan 3ce5741
servant 0.20.1
maksbotan 57e0f29
Drop constraint on warp in cabal.project
maksbotan 8a4a7f5
Constraint http2 <4.2
maksbotan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ name: CI | |
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
cabal: | ||
|
@@ -20,6 +22,7 @@ jobs: | |
- "9.2.8" | ||
- "9.4.5" | ||
- "9.6.2" | ||
fail-fast: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change seems unrelated to this PR. |
||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -75,13 +75,7 @@ import Control.Monad.Compat | |||||||||||||
import Control.DeepSeq | ||||||||||||||
(NFData) | ||||||||||||||
import Data.Aeson | ||||||||||||||
(FromJSON (..), ToJSON (..), encode) | ||||||||||||||
import Data.Aeson.Parser | ||||||||||||||
(value) | ||||||||||||||
import Data.Aeson.Types | ||||||||||||||
(parseEither) | ||||||||||||||
import Data.Attoparsec.ByteString.Char8 | ||||||||||||||
(endOfInput, parseOnly, skipSpace, (<?>)) | ||||||||||||||
(FromJSON (..), ToJSON (..), encode, eitherDecode) | ||||||||||||||
import Data.Bifunctor | ||||||||||||||
(bimap) | ||||||||||||||
import qualified Data.ByteString as BS | ||||||||||||||
|
@@ -371,28 +365,15 @@ instance NFData NoContent | |||||||||||||
-------------------------------------------------------------------------- | ||||||||||||||
-- * MimeUnrender Instances | ||||||||||||||
|
||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
-- | Like 'Data.Aeson.eitherDecode' but allows all JSON values instead of just | ||||||||||||||
-- objects and arrays. | ||||||||||||||
-- | Deprecated: since aeson version 0.9 `eitherDecode` has lenient behavior. | ||||||||||||||
-- | ||||||||||||||
-- Will handle trailing whitespace, but not trailing junk. ie. | ||||||||||||||
-- | ||||||||||||||
-- >>> eitherDecodeLenient "1 " :: Either String Int | ||||||||||||||
-- Right 1 | ||||||||||||||
-- | ||||||||||||||
-- >>> eitherDecodeLenient "1 junk" :: Either String Int | ||||||||||||||
-- Left "trailing junk after valid JSON: endOfInput" | ||||||||||||||
eitherDecodeLenient :: FromJSON a => ByteString -> Either String a | ||||||||||||||
eitherDecodeLenient input = | ||||||||||||||
parseOnly parser (cs input) >>= parseEither parseJSON | ||||||||||||||
where | ||||||||||||||
parser = skipSpace | ||||||||||||||
*> Data.Aeson.Parser.value | ||||||||||||||
<* skipSpace | ||||||||||||||
<* (endOfInput <?> "trailing junk after valid JSON") | ||||||||||||||
eitherDecodeLenient = eitherDecode | ||||||||||||||
{-# DEPRECATED eitherDecodeLenient "use eitherDecode instead" #-} | ||||||||||||||
|
||||||||||||||
-- | `eitherDecode` | ||||||||||||||
instance FromJSON a => MimeUnrender JSON a where | ||||||||||||||
mimeUnrender _ = eitherDecodeLenient | ||||||||||||||
mimeUnrender _ = eitherDecode | ||||||||||||||
|
||||||||||||||
-- | @urlDecodeAsForm@ | ||||||||||||||
-- Note that the @mimeUnrender p (mimeRender p x) == Right x@ law only | ||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unrelated to this PR.