You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something seems to have broken since version 3.0.20 with regards to form parameters because they are no longer generated as arguments to the api methods. Here is an example using petstore.yaml, comparing the java client SDK form method updatePetWithForm generated with version 3.0.20 to a java client SDK form method updatePetWithForm generated with the latest commit
/**
* Build call for updatePetWithForm
* @param petId ID of pet that needs to be updated (required)
- * @param name (optional)- * @param status (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
- public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {+ public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
As you can see, the form variables name and status have been ignored.
This works because the latest version of PetApi.java in the repository is from version 3.0.19
Related issues/PRs
This PR #671 seems to fix this issue for typescript angular. A similar fix may be needed for java (and all it's respective libraries).
Edit: Upon further investigations, I believe the error actually lies somewhere in the transition from v1.0.20 to v1.0.21 in swagger-codegen-generators. I checked out the 3.0.20 version of this repo, and modified the pom.xml file here:
Forwarded from the relevant swagger-codegen issue.
Description
Something seems to have broken since version
3.0.20
with regards to form parameters because they are no longer generated as arguments to the api methods. Here is an example usingpetstore.yaml
, comparing the java client SDK form methodupdatePetWithForm
generated with version 3.0.20 to a java client SDK form methodupdatePetWithForm
generated with the latest commitAs you can see, the form variables
name
andstatus
have been ignored.The corresponding method in
petstore.yaml
file looks like this:https://github.com/swagger-api/swagger-codegen/blob/3c955d7ce9055eb17084bbf0bec97d0c83c119af/modules/swagger-codegen/src/test/resources/3_0_0/petstore.yaml#L181-L208
Swagger-codegen version
I am using the latest version of swagger-codegen as of today
For the comparison
diff
above, I compared it to the homebrewswagger-codegen
command line tool, which is version 3.0.20.Steps to reproduce
It is quick and easy to reproduce by comparing to version 3.0.19 instead of comparing to version 3.0.20 (will have the same result)
After clone and building the 3.0.0 branch repo,
This works because the latest version of
PetApi.java
in the repository is from version 3.0.19Related issues/PRs
This PR #671 seems to fix this issue for typescript angular. A similar fix may be needed for java (and all it's respective libraries).
Edit: Upon further investigations, I believe the error actually lies somewhere in the transition from v1.0.20 to v1.0.21 in swagger-codegen-generators. I checked out the
3.0.20
version of this repo, and modified thepom.xml
file here:https://github.com/swagger-api/swagger-codegen/blob/491044d31c72b05ea24e15c843b1cda81f42e5ab/pom.xml#L1164
Changing from version
1.0.20
to1.0.21-SNAPSHOT
and this results in the form parameters error described above.The text was updated successfully, but these errors were encountered: