Swagger-codegen: [Java]Library support for resteasy when creating java client

Created on 10 Nov 2016  路  11Comments  路  Source: swagger-api/swagger-codegen

Description

For generating a java client I understand that the supported libraries does not include resteasy. Is there a reason for that? In my project I used jersey2 to generate the client and all was well until I had to call the client api from a restful service deployed on wildfly 10. The client builder uses the resteasy libraries which I assume comes with wildfly.

Swagger-codegen version

I am using
swagger-codegen-maven-plugin
2.2.1

Swagger declaration file content or url

at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.withConfig(ResteasyClientBuilder.java:50)
at javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:126)
at io.swagger.client.ApiClient.buildHttpClient(ApiClient.java:676)

Command line used for generation
Steps to reproduce
  1. Generate a simple java swagger client (jersey2)
  2. Try calling the API from a restful service deployed on wildfly 10 (or 9)
Related issues
Suggest a Fix
Java Feature help wanted

All 11 comments

@gayathrigs No one has contributed the resteasy lib to Java API client so far.

May I know if you've cycle to make the contribution? If yes, I can show you some good starting point.

I will some time after next week. So yes, it will be great to have some guidance to get me going.

@gayathrigs a good starting point is to look at how Retrofit2 was added: https://github.com/swagger-api/swagger-codegen/pull/1545

If you need any help, just let us (community) know.

Thank you. I think I have a fair idea of what needs to be done. I will keep you posted with the updates.

@wing328 I have the draft version working . I forked from master. Can I push my changes there? I am not familiar with the procedure. Please let me know.

@gayathrigs you will need to submit a PR (pull request) by going to https://github.com/gayathrigs/swagger-codegen and click on the "New pull request" button.

I am also interested in a resteasy Client. I checked out @gayathrigs branch, but it seems not to be finished yet. Is anyone still working on this branch?

I would suggest adding @gayathrigs work to the master as a starting point so that others can submit PRs to enhance it.

@gayathrigs do you need help filing a PR? or you want us to do it for you?

@wing328 and @agu780ph I have filed a PR with the changes that I have. Please review them. I have added java-petstore-resteasy.sh and java-petstore-resteasy.json to the bin folder. But when I ran it I got some errors. I will look into that later.

@gayathrigs thanks for the PR. I'll review shortly.

PR (https://github.com/swagger-api/swagger-codegen/pull/5379) merged into master. Thanks for your contribution.

Was this page helpful?
0 / 5 - 0 ratings