Created by: orange-buffalo
Status Quo
Currently it is not possible to pass any additional per-request configuration to middleware/interceptors used by the clients created by typescript-fetch
generator.
An example where such configuration is useful could be:
- Application that uses default interceptor for error handling (e.g. display a growl message to a user whenever a request fails).
- In some particular cases, this default behaviour is not suitable and custom error handling is required for the request (e.g. execute a different request, use cached values, etc).
PR suggestion
This PR suggests to pass additional metadata
to the requests in the generated clients, which is then passed through to the interceptors. Users of the API clients can then provide custom configuration on per-request basis and their interceptors can make the necessary decisions reading this configuration.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
(6.0.1) (patch release),6.1.x
(breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks) -
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.