OpenAPITools / OpenAPITools/openapi-generator
[Question] How to capture 403 response from generated APIClient (java/webclient)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
I generated a client using generatorName java and library webclient. The generate api client works the service side REST api returns success. But when I get a HTTP 403 response, the block() call just hangs.
Code is like this:
ReportsApi reportApi = new ReportsApi();
Mono rsp = reportApi.reportsGetDatasourcesInGroup(UUID.fromString(workspaceId), UUID.fromString(reportId));
Datasources ds= rsp.block();
I attempt to add .onErrorMap() and other on the Mono object, with no luck.
I know why I am getting 403 from the server, but I just need to be able to capture it in code so I can do the appropriate.
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 with the generated Java webclient ReportsApi call and its Mono.block() usage. Reproduce the HTTP 403 response and inspect how the generated client represents that response and propagates errors. Done means the caller can capture the 403 in code and handle it appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100