Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3619 from input-output-hk/KtorZ/DDW-318/fix-prett…
Browse files Browse the repository at this point in the history
…y-encoding

[DDW-318] Remove pretty-encoding for JSONValidationError
  • Loading branch information
KtorZ authored Sep 18, 2018
2 parents 7ebfe13 + e169bd6 commit 71fca29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
- The creation of mnemonic doesn't throw anymore when provided words outside of the BIP39 English dictionnary.
Instead, it returns an error value gracefully (CO-325)

- Response from `JSONValidationError` are now also encoded inline (instead of a pretty-encoding with newlines) (DDW-318)

### Improvements

- Friendly error mistakes from deserializing invalid addresses instead of brutal 500 (CBR-283)
Expand Down
3 changes: 1 addition & 2 deletions wallet-new/src/Cardano/Wallet/API/Response.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Universum (Buildable, Exception, Text, decodeUtf8, toText,

import Control.Lens hiding (Indexable)
import Data.Aeson (FromJSON (..), ToJSON (..), eitherDecode, encode)
import Data.Aeson.Encode.Pretty (encodePretty)
import qualified Data.Aeson.Options as Serokell
import Data.Aeson.TH
import qualified Data.Char as Char
Expand Down Expand Up @@ -225,7 +224,7 @@ data ValidJSON deriving Typeable

instance FromJSON a => MimeUnrender ValidJSON a where
mimeUnrender _ bs = case eitherDecode bs of
Left err -> Left $ decodeUtf8 $ encodePretty (JSONValidationFailed $ toText err)
Left err -> Left $ decodeUtf8 $ encode (JSONValidationFailed $ toText err)
Right v -> return v

instance Accept ValidJSON where
Expand Down

0 comments on commit 71fca29

Please sign in to comment.