Issue 6172 (#6173)

* Changes to allow field names as examples for string properties and multiple items in array during example generation

* Reverting the version to 2.3.0-SNAPSHOT and autogenerated petstore files
This commit is contained in:
Chandan Singh 2017-08-02 04:59:54 -05:00 committed by wing328
parent e9285e31e1
commit 1c4e77585f
36 changed files with 615 additions and 86 deletions

View File

@ -46,7 +46,7 @@ public class ExampleGenerator {
Map<String, String> kv = new HashMap<>(); Map<String, String> kv = new HashMap<>();
kv.put(CONTENT_TYPE, mediaType); kv.put(CONTENT_TYPE, mediaType);
if (property != null && mediaType.startsWith(MIME_TYPE_JSON)) { if (property != null && mediaType.startsWith(MIME_TYPE_JSON)) {
String example = Json.pretty(resolvePropertyToExample(mediaType, property, processedModels)); String example = Json.pretty(resolvePropertyToExample("", mediaType, property, processedModels));
if (example != null) { if (example != null) {
kv.put(EXAMPLE, example); kv.put(EXAMPLE, example);
@ -76,7 +76,7 @@ public class ExampleGenerator {
return output; return output;
} }
private Object resolvePropertyToExample(String mediaType, Property property, Set<String> processedModels) { private Object resolvePropertyToExample(String propertyName, String mediaType, Property property, Set<String> processedModels) {
logger.debug("Resolving example for property {}...", property); logger.debug("Resolving example for property {}...", property);
if (property.getExample() != null) { if (property.getExample() != null) {
logger.debug("Example set in swagger spec, returning example: '{}'", property.getExample().toString()); logger.debug("Example set in swagger spec, returning example: '{}'", property.getExample().toString());
@ -98,8 +98,8 @@ public class ExampleGenerator {
logger.debug("URI or URL format, without default or enum, generating random one."); logger.debug("URI or URL format, without default or enum, generating random one.");
return "http://example.com/aeiou"; return "http://example.com/aeiou";
} }
logger.debug("No values found, using default string 'aeiou' as example"); logger.debug("No values found, using property name " + propertyName + " as example");
return "aeiou"; return propertyName;
} else if (property instanceof BooleanProperty) { } else if (property instanceof BooleanProperty) {
Boolean defaultValue = ((BooleanProperty) property).getDefault(); Boolean defaultValue = ((BooleanProperty) property).getDefault();
if (defaultValue != null) { if (defaultValue != null) {
@ -109,9 +109,13 @@ public class ExampleGenerator {
} else if (property instanceof ArrayProperty) { } else if (property instanceof ArrayProperty) {
Property innerType = ((ArrayProperty) property).getItems(); Property innerType = ((ArrayProperty) property).getItems();
if (innerType != null) { if (innerType != null) {
return new Object[]{ int arrayLength = null == ((ArrayProperty) property).getMaxItems() ? 2 : ((ArrayProperty) property).getMaxItems();
resolvePropertyToExample(mediaType, innerType, processedModels) Object[] objectProperties = new Object[arrayLength];
}; Object objProperty = resolvePropertyToExample(propertyName, mediaType, innerType, processedModels);
for(int i=0; i < arrayLength; i++) {
objectProperties[i] = objProperty;
}
return objectProperties;
} }
} else if (property instanceof DateProperty) { } else if (property instanceof DateProperty) {
return "2000-01-23"; return "2000-01-23";
@ -143,10 +147,10 @@ public class ExampleGenerator {
Map<String, Object> mp = new HashMap<String, Object>(); Map<String, Object> mp = new HashMap<String, Object>();
if (property.getName() != null) { if (property.getName() != null) {
mp.put(property.getName(), mp.put(property.getName(),
resolvePropertyToExample(mediaType, ((MapProperty) property).getAdditionalProperties(), processedModels)); resolvePropertyToExample(propertyName, mediaType, ((MapProperty) property).getAdditionalProperties(), processedModels));
} else { } else {
mp.put("key", mp.put("key",
resolvePropertyToExample(mediaType, ((MapProperty) property).getAdditionalProperties(), processedModels)); resolvePropertyToExample(propertyName, mediaType, ((MapProperty) property).getAdditionalProperties(), processedModels));
} }
return mp; return mp;
} else if (property instanceof ObjectProperty) { } else if (property instanceof ObjectProperty) {
@ -197,7 +201,7 @@ public class ExampleGenerator {
logger.debug("Creating example from model values"); logger.debug("Creating example from model values");
for (String propertyName : impl.getProperties().keySet()) { for (String propertyName : impl.getProperties().keySet()) {
Property property = impl.getProperties().get(propertyName); Property property = impl.getProperties().get(propertyName);
values.put(propertyName, resolvePropertyToExample(mediaType, property, processedModels)); values.put(propertyName, resolvePropertyToExample(propertyName, mediaType, property, processedModels));
} }
impl.setExample(values); impl.setExample(values);
} }

View File

@ -99,6 +99,7 @@ ext {
spring_web_version = "4.3.9.RELEASE" spring_web_version = "4.3.9.RELEASE"
jodatime_version = "2.9.9" jodatime_version = "2.9.9"
junit_version = "4.12" junit_version = "4.12"
jackson_threeten_version = "2.6.4"
} }
dependencies { dependencies {
@ -108,8 +109,7 @@ dependencies {
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version"
compile "joda-time:joda-time:$jodatime_version"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version"
testCompile "junit:junit:$junit_version" testCompile "junit:junit:$junit_version"
} }

View File

@ -11,6 +11,7 @@ Method | HTTP request | Description
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
<a name="fakeOuterBooleanSerialize"></a> <a name="fakeOuterBooleanSerialize"></a>
@ -274,7 +275,7 @@ Float _float = 3.4F; // Float | None
String string = "string_example"; // String | None String string = "string_example"; // String | None
byte[] binary = B; // byte[] | None byte[] binary = B; // byte[] | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
DateTime dateTime = new DateTime(); // DateTime | None OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {
@ -300,7 +301,7 @@ Name | Type | Description | Notes
**string** | **String**| None | [optional] **string** | **String**| None | [optional]
**binary** | **byte[]**| None | [optional] **binary** | **byte[]**| None | [optional]
**date** | **LocalDate**| None | [optional] **date** | **LocalDate**| None | [optional]
**dateTime** | **DateTime**| None | [optional] **dateTime** | **OffsetDateTime**| None | [optional]
**password** | **String**| None | [optional] **password** | **String**| None | [optional]
**paramCallback** | **String**| None | [optional] **paramCallback** | **String**| None | [optional]
@ -375,3 +376,49 @@ No authorization required
- **Content-Type**: */* - **Content-Type**: */*
- **Accept**: */* - **Accept**: */*
<a name="testJsonFormData"></a>
# **testJsonFormData**
> testJsonFormData(param, param2)
test json serialization of form data
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeApi;
FakeApi apiInstance = new FakeApi();
String param = "param_example"; // String | field1
String param2 = "param2_example"; // String | field2
try {
apiInstance.testJsonFormData(param, param2);
} catch (ApiException e) {
System.err.println("Exception when calling FakeApi#testJsonFormData");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **String**| field1 |
**param2** | **String**| field2 |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined

View File

@ -0,0 +1,52 @@
# FakeClassnameTags123Api
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(body)
To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.FakeClassnameTags123Api;
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testClassname(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
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

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
**_byte** | **byte[]** | | **_byte** | **byte[]** | |
**binary** | **byte[]** | | [optional] **binary** | **byte[]** | | [optional]
**date** | [**LocalDate**](LocalDate.md) | | **date** | [**LocalDate**](LocalDate.md) | |
**dateTime** | [**DateTime**](DateTime.md) | | [optional] **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**uuid** | [**UUID**](UUID.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional]
**password** | **String** | | **password** | **String** | |

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**uuid** | [**UUID**](UUID.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional]
**dateTime** | [**DateTime**](DateTime.md) | | [optional] **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**map** | [**Map&lt;String, Animal&gt;**](Animal.md) | | [optional] **map** | [**Map&lt;String, Animal&gt;**](Animal.md) | | [optional]

View File

@ -7,7 +7,7 @@ Name | Type | Description | Notes
**id** | **Long** | | [optional] **id** | **Long** | | [optional]
**petId** | **Long** | | [optional] **petId** | **Long** | | [optional]
**quantity** | **Integer** | | [optional] **quantity** | **Integer** | | [optional]
**shipDate** | [**DateTime**](DateTime.md) | | [optional] **shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] **status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
**complete** | **Boolean** | | [optional] **complete** | **Boolean** | | [optional]

View File

@ -221,14 +221,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-joda</artifactId> <artifactId>jackson-datatype-threetenbp</artifactId>
<version>${jackson-version}</version> <version>${jackson-threetenbp-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency> </dependency>
<!-- test dependencies --> <!-- test dependencies -->
@ -244,7 +239,7 @@
<swagger-annotations-version>1.5.15</swagger-annotations-version> <swagger-annotations-version>1.5.15</swagger-annotations-version>
<spring-web-version>4.3.9.RELEASE</spring-web-version> <spring-web-version>4.3.9.RELEASE</spring-web-version>
<jackson-version>2.8.9</jackson-version> <jackson-version>2.8.9</jackson-version>
<jodatime-version>2.9.9</jodatime-version> <jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
<maven-plugin-version>1.0.0</maven-plugin-version> <maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.12</junit-version> <junit-version>4.12</junit-version>
</properties> </properties>

View File

@ -29,6 +29,11 @@ import org.springframework.util.StringUtils;
import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
import org.threeten.bp.*;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
@ -308,6 +313,12 @@ public class ApiClient {
*/ */
public ApiClient setDateFormat(DateFormat dateFormat) { public ApiClient setDateFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat; this.dateFormat = dateFormat;
for(HttpMessageConverter converter:restTemplate.getMessageConverters()){
if(converter instanceof AbstractJackson2HttpMessageConverter){
ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter)converter).getObjectMapper();
mapper.setDateFormat(dateFormat);
}
}
return this; return this;
} }
@ -563,6 +574,16 @@ public class ApiClient {
RestTemplate restTemplate = new RestTemplate(messageConverters); RestTemplate restTemplate = new RestTemplate(messageConverters);
for(HttpMessageConverter converter:restTemplate.getMessageConverters()){
if(converter instanceof AbstractJackson2HttpMessageConverter){
ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter)converter).getObjectMapper();
ThreeTenModule module = new ThreeTenModule();
module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
mapper.registerModule(module);
}
}
// This allows us to read the response more than once - Necessary for debugging. // This allows us to read the response more than once - Necessary for debugging.
restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory()));
return restTemplate; return restTemplate;

View File

@ -0,0 +1,232 @@
package io.swagger.client;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonTokenId;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils;
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.Instant;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import org.threeten.bp.temporal.Temporal;
import org.threeten.bp.temporal.TemporalAccessor;
import java.io.IOException;
import java.math.BigDecimal;
/**
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s.
* Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format.
*
* @author Nick Williams
*/
public class CustomInstantDeserializer<T extends Temporal>
extends ThreeTenDateTimeDeserializerBase<T> {
private static final long serialVersionUID = 1L;
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(
Instant.class, DateTimeFormatter.ISO_INSTANT,
new Function<TemporalAccessor, Instant>() {
@Override
public Instant apply(TemporalAccessor temporalAccessor) {
return Instant.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, Instant>() {
@Override
public Instant apply(FromIntegerArguments a) {
return Instant.ofEpochMilli(a.value);
}
},
new Function<FromDecimalArguments, Instant>() {
@Override
public Instant apply(FromDecimalArguments a) {
return Instant.ofEpochSecond(a.integer, a.fraction);
}
},
null
);
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
new Function<TemporalAccessor, OffsetDateTime>() {
@Override
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
return OffsetDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromIntegerArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromDecimalArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
@Override
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
}
}
);
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
new Function<TemporalAccessor, ZonedDateTime>() {
@Override
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
return ZonedDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromIntegerArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromDecimalArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
@Override
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
return zonedDateTime.withZoneSameInstant(zoneId);
}
}
);
protected final Function<FromIntegerArguments, T> fromMilliseconds;
protected final Function<FromDecimalArguments, T> fromNanoseconds;
protected final Function<TemporalAccessor, T> parsedToValue;
protected final BiFunction<T, ZoneId, T> adjust;
protected CustomInstantDeserializer(Class<T> supportedType,
DateTimeFormatter parser,
Function<TemporalAccessor, T> parsedToValue,
Function<FromIntegerArguments, T> fromMilliseconds,
Function<FromDecimalArguments, T> fromNanoseconds,
BiFunction<T, ZoneId, T> adjust) {
super(supportedType, parser);
this.parsedToValue = parsedToValue;
this.fromMilliseconds = fromMilliseconds;
this.fromNanoseconds = fromNanoseconds;
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
@Override
public T apply(T t, ZoneId zoneId) {
return t;
}
} : adjust;
}
@SuppressWarnings("unchecked")
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
super((Class<T>) base.handledType(), f);
parsedToValue = base.parsedToValue;
fromMilliseconds = base.fromMilliseconds;
fromNanoseconds = base.fromNanoseconds;
adjust = base.adjust;
}
@Override
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
if (dtf == _formatter) {
return this;
}
return new CustomInstantDeserializer<T>(this, dtf);
}
@Override
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
//string values have to be adjusted to the configured TZ.
switch (parser.getCurrentTokenId()) {
case JsonTokenId.ID_NUMBER_FLOAT: {
BigDecimal value = parser.getDecimalValue();
long seconds = value.longValue();
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
return fromNanoseconds.apply(new FromDecimalArguments(
seconds, nanoseconds, getZone(context)));
}
case JsonTokenId.ID_NUMBER_INT: {
long timestamp = parser.getLongValue();
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
return this.fromNanoseconds.apply(new FromDecimalArguments(
timestamp, 0, this.getZone(context)
));
}
return this.fromMilliseconds.apply(new FromIntegerArguments(
timestamp, this.getZone(context)
));
}
case JsonTokenId.ID_STRING: {
String string = parser.getText().trim();
if (string.length() == 0) {
return null;
}
if (string.endsWith("+0000")) {
string = string.substring(0, string.length() - 5) + "Z";
}
T value;
try {
TemporalAccessor acc = _formatter.parse(string);
value = parsedToValue.apply(acc);
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
return adjust.apply(value, this.getZone(context));
}
} catch (DateTimeException e) {
throw _peelDTE(e);
}
return value;
}
}
throw context.mappingException("Expected type float, integer, or string.");
}
private ZoneId getZone(DeserializationContext context) {
// Instants are always in UTC, so don't waste compute cycles
return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone());
}
private static class FromIntegerArguments {
public final long value;
public final ZoneId zoneId;
private FromIntegerArguments(long value, ZoneId zoneId) {
this.value = value;
this.zoneId = zoneId;
}
}
private static class FromDecimalArguments {
public final long integer;
public final int fraction;
public final ZoneId zoneId;
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
this.integer = integer;
this.fraction = fraction;
this.zoneId = zoneId;
}
}
}

View File

@ -4,8 +4,8 @@ import io.swagger.client.ApiClient;
import java.math.BigDecimal; import java.math.BigDecimal;
import io.swagger.client.model.Client; import io.swagger.client.model.Client;
import org.joda.time.DateTime; import org.threeten.bp.LocalDate;
import org.joda.time.LocalDate; import org.threeten.bp.OffsetDateTime;
import io.swagger.client.model.OuterComposite; import io.swagger.client.model.OuterComposite;
import java.util.ArrayList; import java.util.ArrayList;
@ -214,7 +214,7 @@ public class FakeApi {
* @param paramCallback None * @param paramCallback None
* @throws RestClientException if an error occurs while attempting to invoke the API * @throws RestClientException if an error occurs while attempting to invoke the API
*/ */
public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback) throws RestClientException { public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException {
Object postBody = null; Object postBody = null;
// verify the required parameter 'number' is set // verify the required parameter 'number' is set
@ -337,6 +337,50 @@ public class FakeApi {
String[] authNames = new String[] { }; String[] authNames = new String[] { };
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
* test json serialization of form data
*
* <p><b>200</b> - successful operation
* @param param field1
* @param param2 field2
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void testJsonFormData(String param, String param2) throws RestClientException {
Object postBody = null;
// verify the required parameter 'param' is set
if (param == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testJsonFormData");
}
// verify the required parameter 'param2' is set
if (param2 == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData");
}
String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
if (param != null)
formParams.add("param", param);
if (param2 != null)
formParams.add("param2", param2);
final String[] accepts = { };
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {}; ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
} }

View File

@ -0,0 +1,84 @@
package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@Component("io.swagger.client.api.FakeClassnameTags123Api")
public class FakeClassnameTags123Api {
private ApiClient apiClient;
public FakeClassnameTags123Api() {
this(new ApiClient());
}
@Autowired
public FakeClassnameTags123Api(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test class name in snake case
*
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Client testClassname(Client body) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname");
}
String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] accepts = {
"application/json"
};
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
}

View File

@ -21,8 +21,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.UUID; import java.util.UUID;
import org.joda.time.DateTime; import org.threeten.bp.LocalDate;
import org.joda.time.LocalDate; import org.threeten.bp.OffsetDateTime;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.*;
@ -87,7 +87,7 @@ public class FormatTest {
@JsonProperty("dateTime") @JsonProperty("dateTime")
@JacksonXmlProperty(localName = "dateTime") @JacksonXmlProperty(localName = "dateTime")
@XmlElement(name = "dateTime") @XmlElement(name = "dateTime")
private DateTime dateTime = null; private OffsetDateTime dateTime = null;
@JsonProperty("uuid") @JsonProperty("uuid")
@JacksonXmlProperty(localName = "uuid") @JacksonXmlProperty(localName = "uuid")
@ -289,7 +289,7 @@ public class FormatTest {
this.date = date; this.date = date;
} }
public FormatTest dateTime(DateTime dateTime) { public FormatTest dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime; this.dateTime = dateTime;
return this; return this;
} }
@ -299,11 +299,11 @@ public class FormatTest {
* @return dateTime * @return dateTime
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public DateTime getDateTime() { public OffsetDateTime getDateTime() {
return dateTime; return dateTime;
} }
public void setDateTime(DateTime dateTime) { public void setDateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime; this.dateTime = dateTime;
} }

View File

@ -24,7 +24,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.joda.time.DateTime; import org.threeten.bp.OffsetDateTime;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.*;
@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("dateTime") @JsonProperty("dateTime")
@JacksonXmlProperty(localName = "dateTime") @JacksonXmlProperty(localName = "dateTime")
@XmlElement(name = "dateTime") @XmlElement(name = "dateTime")
private DateTime dateTime = null; private OffsetDateTime dateTime = null;
@JsonProperty("map") @JsonProperty("map")
@JacksonXmlProperty(localName = "map") @JacksonXmlProperty(localName = "map")
@ -69,7 +69,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.uuid = uuid; this.uuid = uuid;
} }
public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime; this.dateTime = dateTime;
return this; return this;
} }
@ -79,11 +79,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
* @return dateTime * @return dateTime
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public DateTime getDateTime() { public OffsetDateTime getDateTime() {
return dateTime; return dateTime;
} }
public void setDateTime(DateTime dateTime) { public void setDateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime; this.dateTime = dateTime;
} }

View File

@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime; import org.threeten.bp.OffsetDateTime;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.*;
@ -49,7 +49,7 @@ public class Order {
@JsonProperty("shipDate") @JsonProperty("shipDate")
@JacksonXmlProperty(localName = "shipDate") @JacksonXmlProperty(localName = "shipDate")
@XmlElement(name = "shipDate") @XmlElement(name = "shipDate")
private DateTime shipDate = null; private OffsetDateTime shipDate = null;
/** /**
* Order Status * Order Status
@ -152,7 +152,7 @@ public class Order {
this.quantity = quantity; this.quantity = quantity;
} }
public Order shipDate(DateTime shipDate) { public Order shipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate; this.shipDate = shipDate;
return this; return this;
} }
@ -162,11 +162,11 @@ public class Order {
* @return shipDate * @return shipDate
**/ **/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public DateTime getShipDate() { public OffsetDateTime getShipDate() {
return shipDate; return shipDate;
} }
public void setShipDate(DateTime shipDate) { public void setShipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate; this.shipDate = shipDate;
} }

View File

@ -0,0 +1,50 @@
/*
* 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.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 FakeClassnameTags123Api
*/
@Ignore
public class FakeClassnameTags123ApiTest {
private final FakeClassnameTags123Api api = new FakeClassnameTags123Api();
/**
* To test class name in snake case
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testClassnameTest() {
Client body = null;
Client response = api.testClassname(body);
// TODO: test validations
}
}

View File

@ -81,7 +81,7 @@ public class FakeApiController implements FakeApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -33,7 +33,7 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -53,7 +53,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -69,7 +69,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -85,7 +85,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK); return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK);
} }
return new ResponseEntity<Pet>(HttpStatus.OK); return new ResponseEntity<Pet>(HttpStatus.OK);
@ -112,7 +112,7 @@ public class PetApiController implements PetApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"aeiou\", \"message\" : \"aeiou\"}", ModelApiResponse.class), HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}", ModelApiResponse.class), HttpStatus.OK);
} }
return new ResponseEntity<ModelApiResponse>(HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(HttpStatus.OK);

View File

@ -63,7 +63,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"aeiou\", \"lastName\" : \"aeiou\", \"password\" : \"aeiou\", \"userStatus\" : 6, \"phone\" : \"aeiou\", \"id\" : 0, \"email\" : \"aeiou\", \"username\" : \"aeiou\"}", User.class), HttpStatus.OK); return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}", User.class), HttpStatus.OK);
} }
return new ResponseEntity<User>(HttpStatus.OK); return new ResponseEntity<User>(HttpStatus.OK);
@ -80,7 +80,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<String>(objectMapper.readValue("\"aeiou\"", String.class), HttpStatus.OK); return new ResponseEntity<String>(objectMapper.readValue("\"\"", String.class), HttpStatus.OK);
} }
return new ResponseEntity<String>(HttpStatus.OK); return new ResponseEntity<String>(HttpStatus.OK);

View File

@ -81,7 +81,7 @@ public class FakeApiController implements FakeApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -33,7 +33,7 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -53,7 +53,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -69,7 +69,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -85,7 +85,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK); return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK);
} }
return new ResponseEntity<Pet>(HttpStatus.OK); return new ResponseEntity<Pet>(HttpStatus.OK);
@ -112,7 +112,7 @@ public class PetApiController implements PetApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"aeiou\", \"message\" : \"aeiou\"}", ModelApiResponse.class), HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}", ModelApiResponse.class), HttpStatus.OK);
} }
return new ResponseEntity<ModelApiResponse>(HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(HttpStatus.OK);

View File

@ -63,7 +63,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"aeiou\", \"lastName\" : \"aeiou\", \"password\" : \"aeiou\", \"userStatus\" : 6, \"phone\" : \"aeiou\", \"id\" : 0, \"email\" : \"aeiou\", \"username\" : \"aeiou\"}", User.class), HttpStatus.OK); return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}", User.class), HttpStatus.OK);
} }
return new ResponseEntity<User>(HttpStatus.OK); return new ResponseEntity<User>(HttpStatus.OK);
@ -80,7 +80,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<String>(objectMapper.readValue("\"aeiou\"", String.class), HttpStatus.OK); return new ResponseEntity<String>(objectMapper.readValue("\"\"", String.class), HttpStatus.OK);
} }
return new ResponseEntity<String>(HttpStatus.OK); return new ResponseEntity<String>(HttpStatus.OK);

View File

@ -81,7 +81,7 @@ public class FakeApiController implements FakeApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -33,7 +33,7 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -52,7 +52,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -68,7 +68,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -84,7 +84,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK); return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK);
} }
return new ResponseEntity<Pet>(HttpStatus.OK); return new ResponseEntity<Pet>(HttpStatus.OK);
@ -111,7 +111,7 @@ public class PetApiController implements PetApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"aeiou\", \"message\" : \"aeiou\"}", ModelApiResponse.class), HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}", ModelApiResponse.class), HttpStatus.OK);
} }
return new ResponseEntity<ModelApiResponse>(HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(HttpStatus.OK);

View File

@ -63,7 +63,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"aeiou\", \"lastName\" : \"aeiou\", \"password\" : \"aeiou\", \"userStatus\" : 6, \"phone\" : \"aeiou\", \"id\" : 0, \"email\" : \"aeiou\", \"username\" : \"aeiou\"}", User.class), HttpStatus.OK); return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}", User.class), HttpStatus.OK);
} }
return new ResponseEntity<User>(HttpStatus.OK); return new ResponseEntity<User>(HttpStatus.OK);
@ -80,7 +80,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<String>(objectMapper.readValue("\"aeiou\"", String.class), HttpStatus.OK); return new ResponseEntity<String>(objectMapper.readValue("\"\"", String.class), HttpStatus.OK);
} }
return new ResponseEntity<String>(HttpStatus.OK); return new ResponseEntity<String>(HttpStatus.OK);

View File

@ -82,7 +82,7 @@ public class FakeApiController implements FakeApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -34,7 +34,7 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -54,7 +54,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -70,7 +70,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -86,7 +86,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK); return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK);
} }
return new ResponseEntity<Pet>(HttpStatus.OK); return new ResponseEntity<Pet>(HttpStatus.OK);
@ -113,7 +113,7 @@ public class PetApiController implements PetApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"aeiou\", \"message\" : \"aeiou\"}", ModelApiResponse.class), HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}", ModelApiResponse.class), HttpStatus.OK);
} }
return new ResponseEntity<ModelApiResponse>(HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(HttpStatus.OK);

View File

@ -64,7 +64,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"aeiou\", \"lastName\" : \"aeiou\", \"password\" : \"aeiou\", \"userStatus\" : 6, \"phone\" : \"aeiou\", \"id\" : 0, \"email\" : \"aeiou\", \"username\" : \"aeiou\"}", User.class), HttpStatus.OK); return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}", User.class), HttpStatus.OK);
} }
return new ResponseEntity<User>(HttpStatus.OK); return new ResponseEntity<User>(HttpStatus.OK);
@ -81,7 +81,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<String>(objectMapper.readValue("\"aeiou\"", String.class), HttpStatus.OK); return new ResponseEntity<String>(objectMapper.readValue("\"\"", String.class), HttpStatus.OK);
} }
return new ResponseEntity<String>(HttpStatus.OK); return new ResponseEntity<String>(HttpStatus.OK);

View File

@ -81,7 +81,7 @@ public class FakeApiController implements FakeApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -33,7 +33,7 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK); return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"client\"}", Client.class), HttpStatus.OK);
} }
return new ResponseEntity<Client>(HttpStatus.OK); return new ResponseEntity<Client>(HttpStatus.OK);

View File

@ -53,7 +53,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -69,7 +69,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK); return new ResponseEntity<List<Pet>>(objectMapper.readValue("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]", List.class), HttpStatus.OK);
} }
return new ResponseEntity<List<Pet>>(HttpStatus.OK); return new ResponseEntity<List<Pet>>(HttpStatus.OK);
@ -85,7 +85,7 @@ public class PetApiController implements PetApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"aeiou\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"aeiou\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"aeiou\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK); return new ResponseEntity<Pet>(objectMapper.readValue("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}", Pet.class), HttpStatus.OK);
} }
return new ResponseEntity<Pet>(HttpStatus.OK); return new ResponseEntity<Pet>(HttpStatus.OK);
@ -112,7 +112,7 @@ public class PetApiController implements PetApi {
// do some magic! // do some magic!
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"aeiou\", \"message\" : \"aeiou\"}", ModelApiResponse.class), HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(objectMapper.readValue("{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}", ModelApiResponse.class), HttpStatus.OK);
} }
return new ResponseEntity<ModelApiResponse>(HttpStatus.OK); return new ResponseEntity<ModelApiResponse>(HttpStatus.OK);

View File

@ -63,7 +63,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"aeiou\", \"lastName\" : \"aeiou\", \"password\" : \"aeiou\", \"userStatus\" : 6, \"phone\" : \"aeiou\", \"id\" : 0, \"email\" : \"aeiou\", \"username\" : \"aeiou\"}", User.class), HttpStatus.OK); return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}", User.class), HttpStatus.OK);
} }
return new ResponseEntity<User>(HttpStatus.OK); return new ResponseEntity<User>(HttpStatus.OK);
@ -80,7 +80,7 @@ public class UserApiController implements UserApi {
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
return new ResponseEntity<String>(objectMapper.readValue("\"aeiou\"", String.class), HttpStatus.OK); return new ResponseEntity<String>(objectMapper.readValue("\"\"", String.class), HttpStatus.OK);
} }
return new ResponseEntity<String>(HttpStatus.OK); return new ResponseEntity<String>(HttpStatus.OK);