-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JAVA] Model import in JSON.java file using Swagger Codegen #7836
Comments
may be related to: |
eivinhb
added a commit
to eivinhb/swagger-codegen
that referenced
this issue
May 2, 2018
…wagger-api#7836) After fixes for swagger-api#6636 the gson based clients would not compile if the swagger json did not have any model definitions. This can be the case if the API only uses simple datastructures for input and output. (int, String, List, Map etc.)
4 tasks
crumpf
added a commit
to crumpf/swagger-codegen
that referenced
this issue
Jul 19, 2018
* master: Update README.md fixed NPE on `getHasQueryParams` method. Fix getHasQueryParams to take authMethods into account added null check. added pattern, mixLength, maxLength from "non object" model to a codegen property. updated dependencies versions on CI pom files. bump to released versions Fix getter methods for Java model with additionalProperties set required on response property when schema is not null. updated swagger core and swagger parser versions, also added tests to confirm that issue swagger-api#7980 is solved with these changes. fixed index out of bound exception for inline empty example field. Fix for uncompilable java client if no model definitions i specified (swagger-api#7836) Add option modelPropertyNaming to javascript generator Update PetStore sample Configuration option to disable HTML escaping when using Gson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generating java client from editor.swagger.io
Using command mvn clean package to get swagger-java-client-1.0.0 library, but command prompt is showing this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) onproject swagger-java-client: Compilation failure
[ERROR] /C:/java-client/src/main/java/io
/swagger/client/JSON.java:[30,1] package io.swagger.client.model does not exist
Yesterday it was working fine.
Swagger generated code is importing a package in JSON.java class:
import io.swagger.client.model.*;
But somehow this package is not available in the autogenerated java-client.
I have tried removing this import and compiled the project again it compiled and build successfully, but while using the library file (swagger-java-client-1.0.0) API stopped working.
Then i tried with my earlier version of yaml file to generate code which was working fine yesterday but somehow it is showing the same error.
This model package was not generated in my project which I generated yesterday neither the import (import io.swagger.client.model.*;) was there in my JSON.java file.
expected result:
Should generate JAVA client code which is compilable with or without the model import.
Thank You
Neeraj
The text was updated successfully, but these errors were encountered: