Skip to content

Doesn't fail on parsing failure #12

@nikita-volkov

Description

@nikita-volkov

I have a simple parser specification like this:

postDocuments :: Parser (Text, Aeson.Value)
postDocuments =
  arrayOf element
  where
    element =
      (,) <$>
      objectWithKey "id" string <*>
      objectWithKey "document" value

Whenever I feed it with any unexpected JSON, it doesn't fail. Instead it just results in an empty list. But I need to know when the input is incorrect.

Is this by design? Is there a way to work around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions