Skip to content

Commit

Permalink
fix bug in compressed maybe arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornkihlberg committed Mar 21, 2023
1 parent 5ae99ba commit c8f4889
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -112,7 +112,7 @@ cip25CompressedArray :: FromJSON a => Aeson.Object -> Aeson.Types.Key -> Aeson.T
cip25CompressedArray obj key = (obj .: key) <|> fmap (:[]) (obj .: key)

cip25CompressedMaybeArray :: FromJSON a => Aeson.Object -> Aeson.Types.Key -> Aeson.Types.Parser [a]
cip25CompressedMaybeArray obj key = do x <- obj .:! key; pure (Maybe.maybeToList x) <|> obj .:! key .!= []
cip25CompressedMaybeArray obj key = cip25CompressedArray obj key <|> pure []

instance Aeson.FromJSON CIP25MetadataFileDetails where
parseJSON = Aeson.withObject "CIP25MetadataFileDetails" \x ->
Expand Down

0 comments on commit c8f4889

Please sign in to comment.