0

I am working on a Java Project with Maven, SpringBoot and OpenAPI. In the pom.xml, we added plugin of openapi-generator-maven-plugin version 5.2.1

In the openapi yaml file we have path like below as an example: "api/v1/companies/{companyId}/employees"

The plugin works and we have the client api (EmployeeApi.java) generated. But when I use this generated api to call, I got an URISyntaxException. With debug I localed the issue happens on the line of UriBuilder uriBuilder = UriBuiler.fromUri(this.apiClient.getBasePath() + "/api/v1/companies/{companyId}/employees");

And it complains the error is the incorrect character of "{"

I noticed the call of UriBuilder.fromUri() will eventually create the URI object by new URI(str) so it cannot take "{" as a valid path. My question is I have no control of the generated codes, how could we ask the generator to use UriBuilder.fromResource or something else which could make this working?

Thanks

Ran
  • 55
  • 1
  • 10
  • why do you need to use UriBuilder? The base idea is to get feign or retrofit and just use them. – Andrey B. Panfilov Oct 03 '22 at 03:19
  • Hi @AndreyB.Panfilov, I might not make it clear. The UriBuilder line comes from the auto-generatoed codes from that openapi-generator-maven-plugin. – Ran Oct 03 '22 at 18:02

1 Answers1

0

We decided to use one of "resttemplate", "rest-assure" or "apache-httpclient" instead of google-api

Ran
  • 55
  • 1
  • 10