Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ For latest version of this document see [`ChangeLog.md on GitHub`](https://githu

### HEAD (unreleased changes)

* (**change**) Update aeson dependency to v2.

* (**breaking change**) Removed support for `servant-server-0.15`.

* (**change**) Introduces module `Network.WAI.RFC7807` which provides
Expand Down
42 changes: 36 additions & 6 deletions http-rfc7807.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.33.0.
-- This file has been generated from package.yaml by hpack version 0.35.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 44f6128d5aaacd79e8e8dd1f297081d27f76711c67b1f7f1be63dff32a2f8f38
-- hash: a2d71b2ee3f8ed70f417c42fb3520ef5387868a9aa06794325489c517b6e47e1

name: http-rfc7807
version: 0.2.0.0
Expand Down Expand Up @@ -41,10 +41,25 @@ library
Paths_http_rfc7807
hs-source-dirs:
src
default-extensions: BlockArguments DeriveGeneric DerivingStrategies DuplicateRecordFields FlexibleContexts FlexibleInstances InstanceSigs LambdaCase MultiParamTypeClasses NamedFieldPuns NoImplicitPrelude OverloadedStrings RecordWildCards ScopedTypeVariables TypeApplications
default-extensions:
BlockArguments
DeriveGeneric
DerivingStrategies
DuplicateRecordFields
FlexibleContexts
FlexibleInstances
InstanceSigs
LambdaCase
MultiParamTypeClasses
NamedFieldPuns
NoImplicitPrelude
OverloadedStrings
RecordWildCards
ScopedTypeVariables
TypeApplications
ghc-options: -Wall -Wcompat
build-depends:
aeson >=1.4.1.0 && <2
aeson >=1.4.1.0
, base >=4.12 && <5
, http-media >=0.7.1.3 && <1
, http-types >=0.12.2 && <1
Expand All @@ -61,11 +76,26 @@ test-suite command-wrapper-tests
Paths_http_rfc7807
hs-source-dirs:
test
default-extensions: BlockArguments DeriveGeneric DerivingStrategies DuplicateRecordFields FlexibleContexts FlexibleInstances InstanceSigs LambdaCase MultiParamTypeClasses NamedFieldPuns NoImplicitPrelude OverloadedStrings RecordWildCards ScopedTypeVariables TypeApplications
default-extensions:
BlockArguments
DeriveGeneric
DerivingStrategies
DuplicateRecordFields
FlexibleContexts
FlexibleInstances
InstanceSigs
LambdaCase
MultiParamTypeClasses
NamedFieldPuns
NoImplicitPrelude
OverloadedStrings
RecordWildCards
ScopedTypeVariables
TypeApplications
ghc-options: -Wall -Wcompat -threaded -rtsopts -with-rtsopts=-N
build-depends:
HUnit >=1.6.0.0 && <1.7
, aeson >=1.4.1.0 && <2
, aeson >=1.4.1.0
, base >=4.12 && <5
, call-stack >=0.2.0 && <1
, hspec-expectations-json >=1.0.0.0 && <2
Expand Down
4 changes: 2 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ library:
source-dirs: src

dependencies:
- aeson >=1.4.1.0 && <2
- aeson >=1.4.1.0
# ^ Lower bound based on servant.
- http-types >=0.12.2 && <1
# ^ Version 0.7.0 is the first one that provides hContentType that we are
Expand Down Expand Up @@ -85,7 +85,7 @@ tests:
# - tasty-quickcheck

# Same dependencies as the library:
- aeson >=1.4.1.0 && <2
- aeson >=1.4.1.0
- http-types >=0.12.2 && <1
- servant >=0.16 && <1
- servant-server >=0.16 && <1
Expand Down
4 changes: 2 additions & 2 deletions src/Network/HTTP/RFC7807.hs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ data EncodingOptions = EncodingOptions
-- extension fields for which the function returns @True@. Ignored
-- extension fields will always be set to 'Nothing'.

, extensionFieldName :: ExtensionField -> Text
, extensionFieldName :: ExtensionField -> Aeson.Key
-- ^ How should the extension fields be named?
--
-- Fields @error_@ and @context@ of 'Rfc7807Error' are not defined by
Expand Down Expand Up @@ -379,7 +379,7 @@ toKeyValue EncodingOptions{..} Rfc7807Error{..} = mconcat
, extField ContextField context
]
where
field :: Aeson.ToJSON a => Text -> Maybe a -> kv
field :: Aeson.ToJSON a => Aeson.Key -> Maybe a -> kv
field name value =
mwhen (not omitNothingFields || isJust value)
(name .= value)
Expand Down
8 changes: 1 addition & 7 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
# https://docs.haskellstack.org/en/stable/yaml_configuration/

# GHC 8.8.4
resolver:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/31.yaml
resolver: lts-20.1

packages:
- .

extra-deps:
- hspec-expectations-json-1.0.0.0

# flags: {}
18 changes: 5 additions & 13 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages:
- completed:
hackage: hspec-expectations-json-1.0.0.0@sha256:0a846be347980f80beb3f8d4b5ed8349c4a3d1b9cb1098b07b3773dd3dc916c2,3651
pantry-tree:
size: 614
sha256: 8937972bda683e53b7f36a32e7a07cb08402eb4f900b3583d0b11f69efc23c9d
original:
hackage: hspec-expectations-json-1.0.0.0
packages: []
snapshots:
- completed:
size: 534126
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/31.yaml
sha256: 637fb77049b25560622a224845b7acfe81a09fdb6a96a3c75997a10b651667f6
original:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/31.yaml
sha256: b73b2b116143aea728c70e65c3239188998bac5bc3be56465813dacd74215dc5
size: 648424
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/1.yaml
original: lts-20.1