ndmitchell / ndmitchell/hoogle
use null to indicate failure in JSON API
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 803
- Forks
- 152
- PR merge metrics
- No merged PRs in 30d
Description
right now the JSON API uses empty object to indicate failure
https://github.com/ndmitchell/hoogle/blob/f9ca6a1669961386f4293be9edd7267136602d59/src/Input/Item.hs#L136-L150
https://github.com/ndmitchell/hoogle/blob/f9ca6a1669961386f4293be9edd7267136602d59/src/Input/Item.hs#L123-L134
I think it would be desirable to use null or to omit that field entirely. The proposed change can be easily implemented with genericParseJSON.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/Input/Item.hs around lines 123-150 and inspect the JSON parsing setup, especially the use of genericParseJSON. Confirm whether the intended representation is null or an omitted field, then update the failure encoding and verify that the JSON API no longer uses an empty object for failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100