Skip to content

Pdf file request with response headers #1043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

bertramr
Copy link

We have a similar problems like #829 and #981, when trying to access an endpoint with a pdf file and the filename in the header.

Therefore I started working on this branch and fixed it (at least for our problem). Please be aware that this pull request at the moment would introduce breaking change and I doubt it is in the sense of the original design. So in effect I don't expect this to be merged but I still hope it might be useful for someone.

  • ApiResult is now a Generic with body and header.
  • During getOperation both the header and the content from the responses are pushed to the list, handled to create the necessary entries and finally the header is dropped, in order to not polluting the types.
  • A new request function is added, which is chosen, when a responseHeader is included in the options. With that it only includes still only one header

Known short comings:

  • Still only handles one header
  • It is always expected that the first entry is the entry with the binary type, which is not guaranteed to best of my knowledge
  • If a responseHeader is set, the return type is now always a ApiResult and no longer a string.
  • It's missing additional test cases to verify the added behavior

This branch includes other than stated in the contribution guideline merge commits from the two open pull requests (#1037 and #986 )

Would be happy about any feedback.

Best regards and thank you very much for this neat code generator

@ufon
Copy link

ufon commented May 24, 2022

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants