Fixed typespecs, bumped HTTPoison to 1.0 so the header signature matches what is used - #1
Open
Narnach wants to merge 3 commits into
Open
Fixed typespecs, bumped HTTPoison to 1.0 so the header signature matches what is used#1Narnach wants to merge 3 commits into
Narnach wants to merge 3 commits into
Conversation
…hes what is used
HTTPoison < 1.0 only allowed binary header data, such as a `map(binary => binary)` or `[{binary, binary}]`. In 1.0 it is also possible to pass in atoms, such as used in Birdy.
Typespecs in Birdy had two main issues:
* they were overly broad, so `atom` was used where a specific `:ok` or `:form` or `:error` would suffice
* they were factually incorrect when compared to some functions’ return types
`mix dialyzer` is now happy and purring like a kitten.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running Dialyzer against code that used Birdy, we got some strange errors resulting from Birdy's typespecs being inconsistent with the actual behaviour of the code, and its interactions with other libraries. This commit contains the changes we made in order to make Dialyzer happy with Birdy.
HTTPoison version < 1.0 only allowed binary header data, such as a
%{"binary" => "binary"}or[{"binary", "binary"}]. In 1.0 it is also possible to pass in atoms, such as used in Birdy. HTTPoison as dependency was bumped to make this work as expected.Typespecs in Birdy had two main issues:
atomwas used where a specific:okor:formor:errorwould suffice. These have been made more specific, so Dialyzer can help to check that case statements matching the Birdy responses are handled correctly.mix dialyzeris now happy and purring like a kitten, and the tests are still passing as well.