Copy link
Copy Markdown
Contributor
ref https://docs.github.com/rest/reference/gists#create-a-gist
ghci> github (OAuth "...") $ createGistR (NewGist "" (HashMap.fromList [("hoge.txt", NewGistFile "abc")]) False) Right (Gist {...})
about NewGist's fields:
descriptionis optional param according to reference. But, when useMaybetype andNothing, occur errorInvalid request.\\n\\nFor 'properties/description', nil is not a string.. So,descriptionparam isTexttype.publicis optional param according to reference. But, when useMaybetype andNothing, occur errorLeft (ParseError "Error in $.public: expected Bool, but encountered Null"). So,publicparam isBooltype.
Copy link
Copy Markdown
Contributor
{ "foo": null }is not the same as
{}
```.
See https://github.com/phadej/github/blob/master/src/GitHub/Data/Milestone.hs#L56-L65 for an example (filtering out `null`s).| instance Binary NewGist | ||
|
|
||
| instance ToJSON NewGist where | ||
| toJSON (NewGist { newGistDescription = description |
Copy link
Copy Markdown
Contributor
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brackets are redundant
Copy link
Copy Markdown
Contributor Author
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy link
Copy Markdown
Contributor Author
Thank you. Use Maybe a type to description and public params with filter notNull. c44824b