OpenAPITools / OpenAPITools/openapi-generator
[REQ] [rust-reqwest-blocking] Return response headers when present in the response definition
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
I have an API that returns no body and a location header linking to the newly created resource. The header is documented in the openapi specification file.
I would like to be able to get this header in the value returned by the generated function.
Describe the solution you'd like
The documented headers would be returned in a struct like a parsed body would.
Describe alternatives you've considered
Manually editing the code to read the header, but that would be needed every time we want to update the API.
Additional context
The definition looks like this
post:
responses:
"201":
headers:
location:
description: Where to find the newly added object.
schema:
type: string
description: |
Successful importation of the object
e.g. "https://localhost/v1/obj/<random-id>".
Contributor guide
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 locating the rust-reqwest-blocking generator entry point and the generated function's response handling for the OpenAPI response definition shown. Verify how a response with no body is represented, then define completion as exposing the documented location header in the generated return value and validating it with the example specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, rust
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100