input-output-hk / testnet-stake-pool-registry-validator

Testnet stake pool registry validator.
Apache License 2.0
3 stars 0 forks source link

remove superfluous (<?>) and use (.:?) for the description #5

Closed KtorZ closed 4 years ago

KtorZ commented 4 years ago
  1. aeson documentation says the following about <?>:

    Add JSON Path context to a parser When parsing a complex structure, it helps to annotate (sub)parsers with context, so that if an error occurs, you can find its location.

    withObject "Person" $ \o -> Person <$> o .: "name" <?> Key "name" <*> o .: "age" <?> Key "age"

    (Standard methods like '(.:)' already do this.)

  2. The description is actually optional, requiring .: forces the key to be present in the JSON file (possibly null). Using .:? removes this limitation.