Repository navigation
Support hackney 3+ response format in generated clients - #137
Merged
onno-vos-dev merged 1 commit intoNov 10, 2026
Merged
Conversation
hackney 3.0 removed hackney:body/1 and returns the body itself in the response tuple, so generated clients crash on hackney 3 and later. Read the body through a generated response_body/1 helper that returns a binary as is and otherwise calls hackney:body/1, so the clients work with hackney 1.x and 2.x as before and with hackney 3.0 and later. Replace the hackney:client() type, which hackney 3 removed, with term().
onno-vos-dev
approved these changes
Nov 9, 2026
Member
|
I will generate new aws-erlang for you tonight (CET) and roll out a release 👍 Thank you! ❤️ |
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.
Support hackney 3+ response format in generated clients
Fixes #136
hackney 3.0 removed
hackney:body/1and returns the body in the response tuple, so the generated clients crash withundefon hackney 3 or later.Changes in
priv/post.erl.eexandpriv/rest.erl.eex:response_body/1helper: a binary is returned as{ok, Body}, anything else goes throughhackney:body/1, so hackney 1.x and 2.x behave as beforehackney:body(Client)directlyterm()instead of the removedhackney:client()type in the generated specs-ignore_xref([{hackney, body, 1}])How I tested:
mix run generate.exs erlangfrom the currentaws/aws-sdk-go-v2specs into a copy ofaws-erlangaws_sqs:send_message/2against a local HTTP endpoint on both versions: it returns{ok, Result, _}on both (with hackney 1.25.0 the body is read throughhackney:body/1, with 4.9.1 it is already a binary)rebar3 ct(needs the dynamodb-local and s3mock containers), the CI workflow runs itNotes:
aws-erlangbelong to services that are no longer in the specs (for exampleaws_alexa_for_business). The generator does not rewrite them, so they still callhackney:body/1.aws-erlang; that is left to the maintainers.