mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 12:10:54 +00:00
[Java][RESTEasy] fix resteasy dependency issue in pom.xml (#6556)
* fix resteasy dependency issue * add java resteasy petstore to circleci test
This commit is contained in:
parent
8f8515486f
commit
639f88918a
@ -205,6 +205,16 @@
|
||||
<artifactId>resteasy-jackson-provider</artifactId>
|
||||
<version>3.1.3.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.joschi.jackson</groupId>
|
||||
<artifactId>jackson-datatype-threetenbp</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
@ -216,7 +226,7 @@
|
||||
<properties>
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
<resteasy-version>3.1.3.Final</resteasy-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
<jackson-version>2.6.4</jackson-version>
|
||||
{{^java8}}
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
{{/java8}}
|
||||
|
@ -835,6 +835,7 @@
|
||||
<module>samples/client/petstore/java/resttemplate</module>
|
||||
<module>samples/client/petstore/java/resttemplate-withXml</module>
|
||||
<module>samples/client/petstore/java/vertx</module>
|
||||
<module>samples/client/petstore/java/resteasy</module>
|
||||
<module>samples/client/petstore/ruby</module>
|
||||
<module>samples/client/petstore/kotlin/</module>
|
||||
<!-- comment out bash as it's failing after switching to CircleCI
|
||||
|
54
samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md
Normal file
54
samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md
Normal file
@ -0,0 +1,54 @@
|
||||
# AnotherFakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
|
||||
|
||||
<a name="testSpecialTags"></a>
|
||||
# **testSpecialTags**
|
||||
> Client testSpecialTags(body)
|
||||
|
||||
To test special tags
|
||||
|
||||
To test special tags
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.AnotherFakeApi;
|
||||
|
||||
|
||||
AnotherFakeApi apiInstance = new AnotherFakeApi();
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testSpecialTags(body);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
@ -167,6 +167,16 @@
|
||||
<artifactId>resteasy-jackson-provider</artifactId>
|
||||
<version>3.1.3.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.joschi.jackson</groupId>
|
||||
<artifactId>jackson-datatype-threetenbp</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
@ -178,7 +188,7 @@
|
||||
<properties>
|
||||
<swagger-core-version>1.5.15</swagger-core-version>
|
||||
<resteasy-version>3.1.3.Final</resteasy-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
<jackson-version>2.6.4</jackson-version>
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
|
@ -0,0 +1,78 @@
|
||||
package io.swagger.client.api;
|
||||
|
||||
import io.swagger.client.ApiException;
|
||||
import io.swagger.client.ApiClient;
|
||||
import io.swagger.client.Configuration;
|
||||
import io.swagger.client.Pair;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class AnotherFakeApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public AnotherFakeApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public AnotherFakeApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags
|
||||
* @param body client model (required)
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client testSpecialTags(Client body) throws ApiException {
|
||||
Object localVarPostBody = body;
|
||||
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/another-fake/dummy".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
|
||||
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Swagger Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package io.swagger.client.api;
|
||||
|
||||
import io.swagger.client.ApiException;
|
||||
import io.swagger.client.model.Client;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for AnotherFakeApi
|
||||
*/
|
||||
@Ignore
|
||||
public class AnotherFakeApiTest {
|
||||
|
||||
private final AnotherFakeApi api = new AnotherFakeApi();
|
||||
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
*
|
||||
* To test special tags
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testSpecialTagsTest() throws ApiException {
|
||||
Client body = null;
|
||||
Client response = api.testSpecialTags(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
@ -16,8 +16,9 @@ package io.swagger.client.api;
|
||||
import io.swagger.client.ApiException;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import io.swagger.client.model.OuterComposite;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
@ -35,6 +36,70 @@ public class FakeApiTest {
|
||||
private final FakeApi api = new FakeApi();
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer boolean types
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterBooleanSerializeTest() throws ApiException {
|
||||
Boolean body = null;
|
||||
Boolean response = api.fakeOuterBooleanSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of object with outer number type
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterCompositeSerializeTest() throws ApiException {
|
||||
OuterComposite body = null;
|
||||
OuterComposite response = api.fakeOuterCompositeSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer number types
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterNumberSerializeTest() throws ApiException {
|
||||
BigDecimal body = null;
|
||||
BigDecimal response = api.fakeOuterNumberSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer string types
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterStringSerializeTest() throws ApiException {
|
||||
String body = null;
|
||||
String response = api.fakeOuterStringSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
@ -72,7 +137,7 @@ public class FakeApiTest {
|
||||
String string = null;
|
||||
byte[] binary = null;
|
||||
LocalDate date = null;
|
||||
DateTime dateTime = null;
|
||||
OffsetDateTime dateTime = null;
|
||||
String password = null;
|
||||
String paramCallback = null;
|
||||
api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||
@ -103,4 +168,21 @@ public class FakeApiTest {
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* test json serialization of form data
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testJsonFormDataTest() throws ApiException {
|
||||
String param = null;
|
||||
String param2 = null;
|
||||
api.testJsonFormData(param, param2);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user