File tree Expand file tree Collapse file tree 14 files changed +31
-87
lines changed
modules/swagger-codegen/src/main/resources/Java
samples/client/petstore/java
default/src/main/java/io/swagger/client
jersey2/src/main/java/io/swagger/client
okhttp-gson/src/main/java/io/swagger/client Expand file tree Collapse file tree 14 files changed +31
-87
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,13 @@ public class JSON {
12
12
13
13
public JSON() {
14
14
mapper = new ObjectMapper();
15
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
15
16
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false );
16
17
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
17
18
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
18
19
mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
19
20
mapper.registerModule(new JodaModule());
20
- }
21
+ }
21
22
22
23
/**
23
24
* Serialize the given Java object into JSON string.
Original file line number Diff line number Diff line change @@ -23,10 +23,9 @@ public class JSON {
23
23
public JSON(ApiClient apiClient) {
24
24
this.apiClient = apiClient;
25
25
gson = new GsonBuilder()
26
- .serializeNulls()
27
26
.registerTypeAdapter(Date.class, new DateAdapter(apiClient))
28
27
.create();
29
- }
28
+ }
30
29
31
30
public Gson getGson() {
32
31
return gson;
Original file line number Diff line number Diff line change 6
6
7
7
import java .io .IOException ;
8
8
9
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T10:56:59.550-07 :00" )
9
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:29.717+08 :00" )
10
10
public class JSON {
11
11
private ObjectMapper mapper ;
12
12
13
13
public JSON () {
14
14
mapper = new ObjectMapper ();
15
+ mapper .setSerializationInclusion (JsonInclude .Include .NON_NULL );
15
16
mapper .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , false );
16
17
mapper .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
17
18
mapper .enable (SerializationFeature .WRITE_ENUMS_USING_TO_STRING );
18
19
mapper .enable (DeserializationFeature .READ_ENUMS_USING_TO_STRING );
19
20
mapper .registerModule (new JodaModule ());
20
- }
21
+ }
21
22
22
23
/**
23
24
* Serialize the given Java object into JSON string.
Original file line number Diff line number Diff line change 6
6
import io .swagger .client .Pair ;
7
7
import io .swagger .client .TypeRef ;
8
8
9
- import io .swagger .client .model .*;
10
-
11
- import java .util .*;
12
-
13
9
import io .swagger .client .model .Pet ;
14
10
import java .io .File ;
15
11
16
- import java .io .File ;
17
- import java .util .Map ;
18
- import java .util .HashMap ;
12
+ import java .util .*;
19
13
20
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T10:56:59.550-07 :00" )
14
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:29.717+08 :00" )
21
15
public class PetApi {
22
16
private ApiClient apiClient ;
23
17
@@ -272,7 +266,7 @@ public Pet getPetById (Long petId) throws ApiException {
272
266
};
273
267
final String contentType = apiClient .selectHeaderContentType (contentTypes );
274
268
275
- String [] authNames = new String [] { "api_key" , "petstore_auth" };
269
+ String [] authNames = new String [] { "api_key" };
276
270
277
271
278
272
Original file line number Diff line number Diff line change 6
6
import io .swagger .client .Pair ;
7
7
import io .swagger .client .TypeRef ;
8
8
9
- import io .swagger .client .model .*;
10
-
11
- import java .util .*;
12
-
13
9
import java .util .Map ;
14
10
import io .swagger .client .model .Order ;
15
11
16
- import java .io .File ;
17
- import java .util .Map ;
18
- import java .util .HashMap ;
12
+ import java .util .*;
19
13
20
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T10:56:59.550-07 :00" )
14
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:29.717+08 :00" )
21
15
public class StoreApi {
22
16
private ApiClient apiClient ;
23
17
Original file line number Diff line number Diff line change 6
6
import io .swagger .client .Pair ;
7
7
import io .swagger .client .TypeRef ;
8
8
9
- import io .swagger .client .model .*;
10
-
11
- import java .util .*;
12
-
13
9
import io .swagger .client .model .User ;
14
10
import java .util .*;
15
11
16
- import java .io .File ;
17
- import java .util .Map ;
18
- import java .util .HashMap ;
12
+ import java .util .*;
19
13
20
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T10:56:59.550-07 :00" )
14
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:29.717+08 :00" )
21
15
public class UserApi {
22
16
private ApiClient apiClient ;
23
17
Original file line number Diff line number Diff line change 6
6
7
7
import java .io .IOException ;
8
8
9
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T11:29:47.599-07 :00" )
9
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:20.020+08 :00" )
10
10
public class JSON {
11
11
private ObjectMapper mapper ;
12
12
13
13
public JSON () {
14
14
mapper = new ObjectMapper ();
15
+ mapper .setSerializationInclusion (JsonInclude .Include .NON_NULL );
15
16
mapper .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , false );
16
17
mapper .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
17
18
mapper .enable (SerializationFeature .WRITE_ENUMS_USING_TO_STRING );
18
19
mapper .enable (DeserializationFeature .READ_ENUMS_USING_TO_STRING );
19
20
mapper .registerModule (new JodaModule ());
20
- }
21
+ }
21
22
22
23
/**
23
24
* Serialize the given Java object into JSON string.
Original file line number Diff line number Diff line change 6
6
import io .swagger .client .Pair ;
7
7
import io .swagger .client .TypeRef ;
8
8
9
- import io .swagger .client .model .*;
10
-
11
- import java .util .*;
12
-
13
9
import io .swagger .client .model .Pet ;
14
10
import java .io .File ;
15
11
16
- import java .io .File ;
17
- import java .util .Map ;
18
- import java .util .HashMap ;
12
+ import java .util .*;
19
13
20
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T11:29:47.599-07 :00" )
14
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:20.020+08 :00" )
21
15
public class PetApi {
22
16
private ApiClient apiClient ;
23
17
@@ -243,7 +237,7 @@ public Pet getPetById (Long petId) throws ApiException {
243
237
};
244
238
final String contentType = apiClient .selectHeaderContentType (contentTypes );
245
239
246
- String [] authNames = new String [] { "api_key" , "petstore_auth" };
240
+ String [] authNames = new String [] { "api_key" };
247
241
248
242
249
243
TypeRef returnType = new TypeRef <Pet >() {};
Original file line number Diff line number Diff line change 6
6
import io .swagger .client .Pair ;
7
7
import io .swagger .client .TypeRef ;
8
8
9
- import io .swagger .client .model .*;
10
-
11
- import java .util .*;
12
-
13
9
import java .util .Map ;
14
10
import io .swagger .client .model .Order ;
15
11
16
- import java .io .File ;
17
- import java .util .Map ;
18
- import java .util .HashMap ;
12
+ import java .util .*;
19
13
20
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T11:29:47.599-07 :00" )
14
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:20.020+08 :00" )
21
15
public class StoreApi {
22
16
private ApiClient apiClient ;
23
17
Original file line number Diff line number Diff line change 6
6
import io .swagger .client .Pair ;
7
7
import io .swagger .client .TypeRef ;
8
8
9
- import io .swagger .client .model .*;
10
-
11
- import java .util .*;
12
-
13
9
import io .swagger .client .model .User ;
14
10
import java .util .*;
15
11
16
- import java .io .File ;
17
- import java .util .Map ;
18
- import java .util .HashMap ;
12
+ import java .util .*;
19
13
20
- @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-20T11:29:47.599-07 :00" )
14
+ @ javax .annotation .Generated (value = "class io.swagger.codegen.languages.JavaClientCodegen" , date = "2015-10-21T11:55:20.020+08 :00" )
21
15
public class UserApi {
22
16
private ApiClient apiClient ;
23
17
You can’t perform that action at this time.
0 commit comments