cancel
Showing results for 
Search instead for 
Did you mean: 
Welcome to the September Hub-bub

We are inviting you to join our exciting online event where you can learn a lot of useful information, share your knowledge and have fun. Each week, we will reward the best posters with free gift cards .

Just pick any topic you like in the SwaggerHub Community, or create your own to dive into the wonderful September Hub-bub.

Event duration: September 2-27. More information.

This Week Top Contributors:

We will decide the winners next Monday

Unable to generate Java client using Spring RestTemplate

Highlighted
Visitor

Unable to generate Java client using Spring RestTemplate

Whenever I try to generate a Java client using Spring RestTemplate I receive the following error:
 
SwaggerHub Error
There was an error generating the clients java code. Please ensure that the definition and all external refs (inc. domains) are valid.
 
There are no errors shown in the editor, and selecting any other library option gives me an instant download. I have tried either setting or leaving every other codegen option blank to try, and it is Spring RestTemplate as the library that triggers this error.
 
What can I do to get this to work (apart from choosing another library)?
4 REPLIES 4
Staff

Re: Unable to generate Java client using Spring RestTemplate

Apologizing for the late reply, this is solved in latest SwaggerHub

New Contributor

Re: Unable to generate Java client using Spring RestTemplate

Capture.PNG

I am still seeing this issue.

My API is using OAS3.

All server stubs and client SDKs give the same error.

Staff

Re: Unable to generate Java client using Spring RestTemplate

Are you getting the error with any language or just with spring? and can you please share a spec causing the error?

New Contributor

Re: Unable to generate Java client using Spring RestTemplate

I think I narrowed down the problem to a schema which uses the "oneOf" key word in the respose. I am getting the error with every language, both clients and servers.

 

Here is an example with the offending schema:

https://app.swaggerhub.com/apis/PlantBreedingAPI/CodeGen_Error_Demo/1.0.0

 

thx for the help

New Here?
Join us and watch the welcome video:
Watch the New Interview
7Mistakes
Join the September Hub-bub to show off, learn and win