Can not generate Java client for Swagger/OpenAPI spec

In our test project (Spring Boot app) we would like to use Zoom API. So we tried to generate java client using:

java -jar swagger-codegen-cli-2.4.7.jar generate -i https://marketplace.zoom.us/docs/api-reference/zoom-api/Zoom%20API.oas2.json -l java

It’s generate java client, but when I build it, several compilation problem occurred, e.g.

 symbol:   class object
  location: class MeetingsApi
C:\GIT\test-app\src\main\java\io\swagger\client\api\MeetingsApi.java:1643: error: cannot find symbol
    public com.squareup.okhttp.Call meetingRegistrantQuestionUpdateCall(Integer meetingId, object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
                                                                                           ^

Question: Is it possible to generate java client from “Zoom API.oas2.json”? Or may be it’s possible to use some Zoom SDK for java, to avoid using plain Unirest/OkHttp ?

Thanks,

Hey @hkyseliov,

We do have a Java SDK for Android.

I will look into the issues with generating the swagger file.

Thanks,
Tommy

Hi @tommy, thanks for quick reply!

Hey @hkyseliov,

Can you see if this JSON works?

https://gist.githubusercontent.com/tommygaessler/0f6fa1eeeb019ee7ac0489cb6ff20783/raw/b003f2d9a62440da06aad5c3e7069a4f977b3c58/zoom-api.json

(Note: Some of the error codes may be off, as I had to change the 4 digit ones to fix the build issue.)

Let me know if this works!

Thanks,
Tommy

Hi @tommy,

thanks for your reply. We tried to generate java client from zoom-api.json you provided us, now it’s generated without 4 digits status code warnings, but sill can not generate some models for some APIs.

e.g. can not create model for meeting update, swagger codegen generate something like this:

public void meetingUpdate(Integer meetingId, UNKNOWN_BASE_TYPE body, String occurrenceId) throws ApiException

the same as for:

public InlineResponse2015 meetingCreate(String userId, UNKNOWN_BASE_TYPE body) throws ApiException
InlineResponse2017 meetingPollCreate(Integer meetingId, UNKNOWN_BASE_TYPE body)
void meetingPollUpdate(Integer meetingId, String pollId, UNKNOWN_BASE_TYPE body)
meetingRegistrantCreate(Integer meetingId, UNKNOWN_BASE_TYPE body, String occurrenceIds) throws ApiException

as well as for some other APIs: BillingApi, CloudRecordingApi, DashboardsApi, DevicesApi, ImChatApi, PhoneApi, ReportsApi, WebinarsApi

We tried to generate it with different tools like : https://editor.swagger.io/, using command line cli swagger-codegen-cli-2.4.7.jar , generate from gradle project using gradle swagger codegen plugin with different versions using “java” language and different libraries(jersey1, jersey2, okhhttp etc.) but all of them generate the code with some unknown models.

Thanks,
Hennadiy

Hey @hkyseliov,

Thanks for all the details. We will work on fixing this and get back to you.

Updating with ticket DEVELOPERS-404

Thanks,
Tommy

Hey @hkyseliov,

The swagger JSON file has been fixed :slight_smile: give it a try!

https://marketplace.zoom.us/docs/api-reference/zoom-api/Zoom%20API.oas2.json

Thanks,
Tommy

1 Like

Hello Tommy,

The API file loads properly in the Swagger editor tool, now that the extended response codes have been taken care of, but we are still seeing the same issues trying to generate java client code. Tried both Swagger and the OpenAPI codegen tools, and they both fail:

For e.g.,
Swagger (notice the lower case object):
object cannot be resolved to a type:
public InlineResponse2003 accountPlanCreate(String accountId, object body) throws ApiException {

OpenAPI:
UNKNOWN_BASE_TYPE cannot be resolved to a type:
public InlineResponse2003 accountPlanCreate(String accountId, UNKNOWN_BASE_TYPE body) throws ApiException {

There are a bunch of other errors while generating the code as well. I can upload all of the logs if needed.

Any help is highly appreciated.

Thanks,
-sr-

Hey @sassy, thanks for posting, and apologies that there are still issues with this!

Can you provide steps to reproduce those errors (how to generate java client code)?

Also if you could provide all the logs, that would be great!

Thanks,
Tommy

Hello @tommy,

Where should I upload the logs?

Thanks,
-sr-

Hey @sassy,

You could upload them at gist.github.com or another cloud hosting platform and share the link here or private message it to me.

Thanks,
Tommy

Hi @tommy,

Having trouble with gist at the moment, here you go - https://drive.google.com/drive/folders/1x4g_Uk5_GtJKbn2b37d0DdbKYKXr6DWb

Thanks,
-sr-

Thanks @sassy,

We will take a look and post back here with updates.

Hey @sassy,

Our team looked into this, we believe your issue is related to an issue with swagger. (Although we did update our OpenAPI to fix other issues, so would be worth a shot to try again).

Can you take a look at these threads and let me know if that fixes your issue?

Thanks,
Tommy

Hey guys,

I’m having the same issue. Using OpenAPI Generator version 4.1.3, tried both Kotlin and Java generators and both result in meetingCreate() having “UNKNOWN_BASE_TYPE body” as a parameter.

Using Zoom API spec downloaded a day ago.

Hey @tomas, thanks for reaching out and using Zoom!

We are looking into this and will post back with an update.

Thanks,
Tommy

@tommy, I don’t think either of the links you posted are the solution to this problem. I am using a later version that supposed to have fixed a similar looking error message.

Thanks,
-sr-

Thanks @sassy,

We will work on fixing this asap. JIRA: DEVELOPERS-404

-Tommy

Hey @sassy, @tomas, @hkyseliov,

We have updated the Java Client Library:

And the updated Open API JSON:

Let me know if this works for you all! :slight_smile:

Thanks,
Tommy

will check this out and get back to you.

thanks, @tommy.

1 Like