forked from loafle/openapi-generator-original
* hashCode and equals support for jdk6 for jersey2 * supportJava6 moved to the base abstract class to support server side code generation, supportJava6 flag was added to the server side model classes generators, licenseInfo ttemplate was added to JavaJaxRS section, javaJaxRS templates jdk6 suport was added, shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes? * fix for the build. * supportJava6 moved to the base abstract class to support server side code generation, supportJava6 flag was added to the server side model classes generators, licenseInfo ttemplate was added to JavaJaxRS section, javaJaxRS templates jdk6 suport was added, shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes? * fix for the build. * Merge remote-tracking branch 'remotes/origin/master' into jdk6-jersey2-support Conflicts: modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java modules/swagger-codegen/src/main/resources/Java/pom.mustache * add msf4j author * [Java] Fix outputFolder in java-related server stub generators (#4076) * fix outputFolder in java-related server stub generator * fix style in JavaJAXRSCXFCDIServerCodegen * hashCode and equals support for jdk6 for jersey2 * supportJava6 moved to the base abstract class to support server side code generation, supportJava6 flag was added to the server side model classes generators, licenseInfo ttemplate was added to JavaJaxRS section, javaJaxRS templates jdk6 suport was added, shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes? * fix for the build. * supportJava6 moved to the base abstract class to support server side code generation, supportJava6 flag was added to the server side model classes generators, licenseInfo ttemplate was added to JavaJaxRS section, javaJaxRS templates jdk6 suport was added, shouldOverride method was commented out to allow server classes to be overriden - what if new methods or signatures changes? * Merge remote-tracking branch 'remotes/origin/master' into jdk6-jersey2-support Conflicts: modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java modules/swagger-codegen/src/main/resources/Java/pom.mustache * Merge remote-tracking branch 'remotes/origin/master' into jdk6-jersey2-support Conflicts: modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java modules/swagger-codegen/src/main/resources/Java/pom.mustache
# {{artifactId}}
## Requirements
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
## Installation
To install the API client library to your local Maven repository, simply execute:
```shell
mvn install
```
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
```shell
mvn deploy
```
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
### Maven users
Add this dependency to your project's POM:
```xml
<dependency>
<groupId>{{{groupId}}}</groupId>
<artifactId>{{{artifactId}}}</artifactId>
<version>{{{artifactVersion}}}</version>
<scope>compile</scope>
</dependency>
```
### Gradle users
Add this dependency to your project's build file:
```groovy
compile "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}"
```
### Others
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
* target/{{{artifactId}}}-{{{artifactVersion}}}.jar
* target/lib/*.jar
## Getting Started
Please follow the [installation](#installation) instruction and execute the following Java code:
```java
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
import {{{invokerPackage}}}.*;
import {{{invokerPackage}}}.auth.*;
import {{{modelPackage}}}.*;
import {{{package}}}.{{{classname}}};
import java.io.File;
import java.util.*;
public class {{{classname}}}Example {
public static void main(String[] args) {
{{#hasAuthMethods}}ApiClient defaultClient = Configuration.getDefaultApiClient();
{{#authMethods}}{{#isBasic}}
// Configure HTTP basic authorization: {{{name}}}
HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}");
{{{name}}}.setUsername("YOUR USERNAME");
{{{name}}}.setPassword("YOUR PASSWORD");{{/isBasic}}{{#isApiKey}}
// Configure API key authorization: {{{name}}}
ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}");
{{{name}}}.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}}
// Configure OAuth2 access token for authorization: {{{name}}}
OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}");
{{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}
{{/authMethods}}
{{/hasAuthMethods}}
{{{classname}}} apiInstance = new {{{classname}}}();
{{#allParams}}
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
{{/allParams}}
try {
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
System.out.println(result);{{/returnType}}
} catch (ApiException e) {
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
e.printStackTrace();
}
}
}
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
```
## Documentation for API Endpoints
All URIs are relative to *{{basePath}}*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
## Documentation for Models
{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md)
{{/model}}{{/models}}
## Documentation for Authorization
{{^authMethods}}All endpoints do not require authorization.
{{/authMethods}}Authentication schemes defined for the API:
{{#authMethods}}### {{name}}
{{#isApiKey}}- **Type**: API key
- **API key parameter name**: {{keyParamName}}
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
{{/isApiKey}}
{{#isBasic}}- **Type**: HTTP basic authentication
{{/isBasic}}
{{#isOAuth}}- **Type**: OAuth
- **Flow**: {{flow}}
- **Authorizatoin URL**: {{authorizationUrl}}
- **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}} - {{scope}}: {{description}}
{{/scopes}}
{{/isOAuth}}
{{/authMethods}}
## Recommendation
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
## Author
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
{{/hasMore}}{{/apis}}{{/apiInfo}}