Skip to content

Instantly share code, notes, and snippets.

@javajack
Created February 20, 2020 09:48
Show Gist options
  • Save javajack/8c1064c116c00edb67e3c1ab61dd9d70 to your computer and use it in GitHub Desktop.
Save javajack/8c1064c116c00edb67e3c1ab61dd9d70 to your computer and use it in GitHub Desktop.
swagger code generator example with specific atguments
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i /home/ubuntu/fineract/fineract-provider/src/main/resources/swagger-ui/response.json -l java --library resttemplate -o /home/ubuntu/temp-swagger/
a
{
"sortParamsByRequiredFlag": {
"opt": "sortParamsByRequiredFlag",
"description": "Sort method arguments to place required parameters before optional parameters.",
"type": "boolean",
"default": "true"
},
"ensureUniqueParams": {
"opt": "ensureUniqueParams",
"description": "Whether to ensure parameter names are unique in an operation (rename parameters that are not).",
"type": "boolean",
"default": "true"
},
"allowUnicodeIdentifiers": {
"opt": "allowUnicodeIdentifiers",
"description": "boolean, toggles whether unicode identifiers are allowed in names or not, default is false",
"type": "boolean",
"default": "false"
},
"modelPackage": {
"opt": "modelPackage",
"description": "package for generated models",
"type": "string"
},
"apiPackage": {
"opt": "apiPackage",
"description": "package for generated api classes",
"type": "string"
},
"invokerPackage": {
"opt": "invokerPackage",
"description": "root package for generated code",
"type": "string"
},
"groupId": {
"opt": "groupId",
"description": "groupId in generated pom.xml",
"type": "string"
},
"artifactId": {
"opt": "artifactId",
"description": "artifactId in generated pom.xml",
"type": "string"
},
"artifactVersion": {
"opt": "artifactVersion",
"description": "artifact version in generated pom.xml",
"type": "string"
},
"artifactUrl": {
"opt": "artifactUrl",
"description": "artifact URL in generated pom.xml",
"type": "string"
},
"artifactDescription": {
"opt": "artifactDescription",
"description": "artifact description in generated pom.xml",
"type": "string"
},
"scmConnection": {
"opt": "scmConnection",
"description": "SCM connection in generated pom.xml",
"type": "string"
},
"scmDeveloperConnection": {
"opt": "scmDeveloperConnection",
"description": "SCM developer connection in generated pom.xml",
"type": "string"
},
"scmUrl": {
"opt": "scmUrl",
"description": "SCM URL in generated pom.xml",
"type": "string"
},
"developerName": {
"opt": "developerName",
"description": "developer name in generated pom.xml",
"type": "string"
},
"developerEmail": {
"opt": "developerEmail",
"description": "developer email in generated pom.xml",
"type": "string"
},
"developerOrganization": {
"opt": "developerOrganization",
"description": "developer organization in generated pom.xml",
"type": "string"
},
"developerOrganizationUrl": {
"opt": "developerOrganizationUrl",
"description": "developer organization URL in generated pom.xml",
"type": "string"
},
"licenseName": {
"opt": "licenseName",
"description": "The name of the license",
"type": "string"
},
"licenseUrl": {
"opt": "licenseUrl",
"description": "The URL of the license",
"type": "string"
},
"sourceFolder": {
"opt": "sourceFolder",
"description": "source folder for generated code",
"type": "string"
},
"localVariablePrefix": {
"opt": "localVariablePrefix",
"description": "prefix for generated code members and local variables",
"type": "string"
},
"serializableModel": {
"opt": "serializableModel",
"description": "boolean - toggle \"implements Serializable\" for generated models",
"type": "boolean",
"default": "false"
},
"bigDecimalAsString": {
"opt": "bigDecimalAsString",
"description": "Treat BigDecimal values as Strings to avoid precision loss.",
"type": "boolean",
"default": "false"
},
"fullJavaUtil": {
"opt": "fullJavaUtil",
"description": "whether to use fully qualified name for classes under java.util. This option only works for Java API client",
"type": "boolean",
"default": "false"
},
"hideGenerationTimestamp": {
"opt": "hideGenerationTimestamp",
"description": "hides the timestamp when files were generated",
"type": "string"
},
"withXml": {
"opt": "withXml",
"description": "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)",
"type": "boolean",
"default": "false"
},
"dateLibrary": {
"opt": "dateLibrary",
"description": "Option. Date library to use",
"type": "string",
"enum": {
"java8-instant": "Java 8 using Instant",
"joda": "Joda (for legacy app only)",
"legacy": "Legacy java.util.Date (if you really have a good reason not to use threetenbp",
"java8-localdatetime": "Java 8 using LocalDateTime (for legacy app only)",
"java8": "Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets \"java8\" to true",
"threetenbp": "Backport of JSR310 (preferred for jdk < 1.8)"
}
},
"java8": {
"opt": "java8",
"description": "Option. Use Java8 classes instead of third party equivalents",
"type": "string",
"enum": {
"true": "Use Java 8 classes such as Base64",
"false": "Various third party libraries as needed"
}
},
"disableHtmlEscaping": {
"opt": "disableHtmlEscaping",
"description": "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)",
"type": "boolean",
"default": "false"
},
"useRxJava": {
"opt": "useRxJava",
"description": "Whether to use the RxJava adapter with the retrofit2 library.",
"type": "boolean",
"default": "false"
},
"useRxJava2": {
"opt": "useRxJava2",
"description": "Whether to use the RxJava2 adapter with the retrofit2 library.",
"type": "boolean",
"default": "false"
},
"parcelableModel": {
"opt": "parcelableModel",
"description": "Whether to generate models for Android that implement Parcelable with the okhttp-gson library.",
"type": "boolean",
"default": "false"
},
"usePlayWS": {
"opt": "usePlayWS",
"description": "Use Play! Async HTTP client (Play WS API)",
"type": "boolean",
"default": "false"
},
"playVersion": {
"opt": "playVersion",
"description": "Version of Play! Framework (possible values \"play24\", \"play25\")",
"type": "string"
},
"supportJava6": {
"opt": "supportJava6",
"description": "Whether to support Java6 with the Jersey1 library.",
"type": "boolean",
"default": "false"
},
"useBeanValidation": {
"opt": "useBeanValidation",
"description": "Use BeanValidation API annotations",
"type": "boolean",
"default": "false"
},
"performBeanValidation": {
"opt": "performBeanValidation",
"description": "Perform BeanValidation",
"type": "boolean",
"default": "false"
},
"useGzipFeature": {
"opt": "useGzipFeature",
"description": "Send gzip-encoded requests",
"type": "boolean",
"default": "false"
},
"useRuntimeException": {
"opt": "useRuntimeException",
"description": "Use RuntimeException instead of Exception",
"type": "boolean",
"default": "false"
},
"library": {
"opt": "library",
"description": "library template (sub-template) to use",
"type": "string",
"default": "okhttp-gson",
"enum": {
"jersey1": "HTTP client: Jersey client 1.19.4. JSON processing: Jackson 2.10.1. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.",
"feign": "HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.10.1",
"jersey2": "HTTP client: Jersey client 2.29.1. JSON processing: Jackson 2.10.1",
"okhttp-gson": "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.",
"retrofit": "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.",
"retrofit2": "HTTP client: OkHttp 3.8.0. JSON processing: Gson 2.6.1 (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)",
"resttemplate": "HTTP client: Spring RestTemplate 4.3.9-RELEASE. JSON processing: Jackson 2.10.1",
"resteasy": "HTTP client: Resteasy client 3.1.3.Final. JSON processing: Jackson 2.10.1",
"vertx": "HTTP client: VertX client 3.2.4. JSON processing: Jackson 2.10.1",
"google-api-client": "HTTP client: Google API client 1.23.0. JSON processing: Jackson 2.10.1",
"rest-assured": "HTTP client: rest-assured : 3.1.0. JSON processing: Gson 2.6.1. Only for Java8"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment