Skip to content

Commit 8f1b693

Browse files
committed
updated java and javascrip sample
1 parent 52e95f3 commit 8f1b693

File tree

361 files changed

+7545
-416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+7545
-416
lines changed

modules/swagger-codegen/src/main/resources/Java/pojo.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/{{#description}}
44
@ApiModel(description = "{{{description}}}"){{/description}}
55
{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
6-
7-
{{#notNullJacksonAnnotation}}@JsonInclude(JsonInclude.Include.NON_NULL){{/notNullJacksonAnnotation}}
8-
6+
{{#notNullJacksonAnnotation}}
7+
@JsonInclude(JsonInclude.Include.NON_NULL)
8+
{{/notNullJacksonAnnotation}}
99
public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcelableModel}}implements Parcelable {{#serializableModel}}, Serializable {{/serializableModel}}{{/parcelableModel}}{{^parcelableModel}}{{#serializableModel}}implements Serializable {{/serializableModel}}{{/parcelableModel}}{
1010
{{#serializableModel}}
1111
private static final long serialVersionUID = 1L;

modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,32 @@ definitions:
14661466
type: string
14671467
OuterBoolean:
14681468
type: boolean
1469+
Boolean:
1470+
type: boolean
1471+
description: True or False indicator
1472+
enum:
1473+
- true
1474+
- false
1475+
Ints:
1476+
type: integer
1477+
format: int32
1478+
description: True or False indicator
1479+
enum:
1480+
- 0
1481+
- 1
1482+
- 2
1483+
- 3
1484+
- 4
1485+
- 5
1486+
- 6
1487+
Numbers:
1488+
type: number
1489+
description: some number
1490+
enum:
1491+
- 7
1492+
- 8
1493+
- 9
1494+
- 10
14691495
externalDocs:
14701496
description: Find out more about Swagger
14711497
url: 'http://swagger.io'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.8-SNAPSHOT
1+
2.4.18-SNAPSHOT
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package io.swagger.client.model;
15+
16+
import java.util.Objects;
17+
import java.util.Arrays;
18+
import io.swagger.annotations.ApiModel;
19+
20+
import com.fasterxml.jackson.annotation.JsonCreator;
21+
import com.fasterxml.jackson.annotation.JsonValue;
22+
23+
/**
24+
* True or False indicator
25+
*/
26+
public enum Ints {
27+
28+
NUMBER_0(0),
29+
30+
NUMBER_1(1),
31+
32+
NUMBER_2(2),
33+
34+
NUMBER_3(3),
35+
36+
NUMBER_4(4),
37+
38+
NUMBER_5(5),
39+
40+
NUMBER_6(6);
41+
42+
private Integer value;
43+
44+
Ints(Integer value) {
45+
this.value = value;
46+
}
47+
48+
@JsonValue
49+
public Integer getValue() {
50+
return value;
51+
}
52+
53+
@Override
54+
public String toString() {
55+
return String.valueOf(value);
56+
}
57+
58+
@JsonCreator
59+
public static Ints fromValue(String text) {
60+
for (Ints b : Ints.values()) {
61+
if (String.valueOf(b.value).equals(text)) {
62+
return b;
63+
}
64+
}
65+
return null;
66+
}
67+
}
68+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package io.swagger.client.model;
15+
16+
import java.util.Objects;
17+
import java.util.Arrays;
18+
import io.swagger.annotations.ApiModel;
19+
20+
import com.fasterxml.jackson.annotation.JsonCreator;
21+
import com.fasterxml.jackson.annotation.JsonValue;
22+
23+
/**
24+
* True or False indicator
25+
*/
26+
public enum ModelBoolean {
27+
28+
TRUE(true),
29+
30+
FALSE(false);
31+
32+
private Boolean value;
33+
34+
ModelBoolean(Boolean value) {
35+
this.value = value;
36+
}
37+
38+
@JsonValue
39+
public Boolean getValue() {
40+
return value;
41+
}
42+
43+
@Override
44+
public String toString() {
45+
return String.valueOf(value);
46+
}
47+
48+
@JsonCreator
49+
public static ModelBoolean fromValue(String text) {
50+
for (ModelBoolean b : ModelBoolean.values()) {
51+
if (String.valueOf(b.value).equals(text)) {
52+
return b;
53+
}
54+
}
55+
return null;
56+
}
57+
}
58+
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package io.swagger.client.model;
15+
16+
import java.util.Objects;
17+
import java.util.Arrays;
18+
import com.fasterxml.jackson.annotation.JsonProperty;
19+
import com.fasterxml.jackson.annotation.JsonCreator;
20+
import com.fasterxml.jackson.annotation.JsonValue;
21+
import io.swagger.annotations.ApiModel;
22+
import io.swagger.annotations.ApiModelProperty;
23+
24+
/**
25+
* ModelList
26+
*/
27+
28+
public class ModelList {
29+
@JsonProperty("123-list")
30+
private String _123List = null;
31+
32+
public ModelList _123List(String _123List) {
33+
this._123List = _123List;
34+
return this;
35+
}
36+
37+
/**
38+
* Get _123List
39+
* @return _123List
40+
**/
41+
@ApiModelProperty(value = "")
42+
public String get123List() {
43+
return _123List;
44+
}
45+
46+
public void set123List(String _123List) {
47+
this._123List = _123List;
48+
}
49+
50+
51+
@Override
52+
public boolean equals(java.lang.Object o) {
53+
if (this == o) {
54+
return true;
55+
}
56+
if (o == null || getClass() != o.getClass()) {
57+
return false;
58+
}
59+
ModelList _list = (ModelList) o;
60+
return Objects.equals(this._123List, _list._123List);
61+
}
62+
63+
@Override
64+
public int hashCode() {
65+
return Objects.hash(_123List);
66+
}
67+
68+
69+
@Override
70+
public String toString() {
71+
StringBuilder sb = new StringBuilder();
72+
sb.append("class ModelList {\n");
73+
74+
sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n");
75+
sb.append("}");
76+
return sb.toString();
77+
}
78+
79+
/**
80+
* Convert the given object to string with each line indented by 4 spaces
81+
* (except the first line).
82+
*/
83+
private String toIndentedString(java.lang.Object o) {
84+
if (o == null) {
85+
return "null";
86+
}
87+
return o.toString().replace("\n", "\n ");
88+
}
89+
90+
}
91+
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Swagger Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package io.swagger.client.model;
15+
16+
import java.util.Objects;
17+
import java.util.Arrays;
18+
import io.swagger.annotations.ApiModel;
19+
import java.math.BigDecimal;
20+
21+
import com.fasterxml.jackson.annotation.JsonCreator;
22+
import com.fasterxml.jackson.annotation.JsonValue;
23+
24+
/**
25+
* some number
26+
*/
27+
public enum Numbers {
28+
29+
NUMBER_7(new BigDecimal(7)),
30+
31+
NUMBER_8(new BigDecimal(8)),
32+
33+
NUMBER_9(new BigDecimal(9)),
34+
35+
NUMBER_10(new BigDecimal(10));
36+
37+
private BigDecimal value;
38+
39+
Numbers(BigDecimal value) {
40+
this.value = value;
41+
}
42+
43+
@JsonValue
44+
public BigDecimal getValue() {
45+
return value;
46+
}
47+
48+
@Override
49+
public String toString() {
50+
return String.valueOf(value);
51+
}
52+
53+
@JsonCreator
54+
public static Numbers fromValue(String text) {
55+
for (Numbers b : Numbers.values()) {
56+
if (String.valueOf(b.value).equals(text)) {
57+
return b;
58+
}
59+
}
60+
return null;
61+
}
62+
}
63+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3-SNAPSHOT
1+
2.4.18-SNAPSHOT
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# Ints
3+
4+
## Enum
5+
6+
7+
* `NUMBER_0` (value: `0`)
8+
9+
* `NUMBER_1` (value: `1`)
10+
11+
* `NUMBER_2` (value: `2`)
12+
13+
* `NUMBER_3` (value: `3`)
14+
15+
* `NUMBER_4` (value: `4`)
16+
17+
* `NUMBER_5` (value: `5`)
18+
19+
* `NUMBER_6` (value: `6`)
20+
21+
22+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# ModelBoolean
3+
4+
## Enum
5+
6+
7+
* `TRUE` (value: `true`)
8+
9+
* `FALSE` (value: `false`)
10+
11+
12+

0 commit comments

Comments
 (0)