Skip to content

Commit 8378133

Browse files
committed
added builders
1 parent f4764e5 commit 8378133

16 files changed

+139
-19
lines changed

modules/swagger-models/src/main/java/io/swagger/models/Response.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public Response headers(Map<String, Property> headers) {
4343
return this;
4444
}
4545

46+
public Response vendorExtension(String key, Object obj) {
47+
this.setVendorExtension(key, obj);
48+
return this;
49+
}
50+
4651
public String getDescription() {
4752
return description;
4853
}

modules/swagger-models/src/main/java/io/swagger/models/properties/ArrayProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public ArrayProperty items(Property items) {
4242
return this;
4343
}
4444

45+
public ArrayProperty vendorExtension(String key, Object obj) {
46+
this.setVendorExtension(key, obj);
47+
return this;
48+
}
49+
4550
public Property getItems() {
4651
return items;
4752
}

modules/swagger-models/src/main/java/io/swagger/models/properties/BooleanProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public BooleanProperty _default(boolean _default) {
3838
return this;
3939
}
4040

41+
public BooleanProperty vendorExtension(String key, Object obj) {
42+
this.setVendorExtension(key, obj);
43+
return this;
44+
}
45+
4146
public Boolean getDefault() {
4247
return _default;
4348
}

modules/swagger-models/src/main/java/io/swagger/models/properties/ByteArrayProperty.java

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,29 @@
77
public class ByteArrayProperty extends AbstractProperty implements Property {
88

99

10-
public ByteArrayProperty() {
11-
super.type = "string";
12-
super.format = "binary";
13-
}
14-
15-
public static boolean isType(String type, String format) {
16-
if("string".equals(type) && "binary".equals(format))
17-
return true;
18-
else return false;
19-
}
20-
public ByteArrayProperty xml(Xml xml) {
21-
this.setXml(xml);
22-
return this;
23-
}
24-
25-
public ByteArrayProperty example(String example) {
26-
this.setExample(example);
27-
return this;
28-
}
10+
public ByteArrayProperty() {
11+
super.type = "string";
12+
super.format = "binary";
13+
}
14+
15+
public static boolean isType(String type, String format) {
16+
if ("string".equals(type) && "binary".equals(format))
17+
return true;
18+
else return false;
19+
}
20+
21+
public ByteArrayProperty xml(Xml xml) {
22+
this.setXml(xml);
23+
return this;
24+
}
25+
26+
public ByteArrayProperty example(String example) {
27+
this.setExample(example);
28+
return this;
29+
}
30+
31+
public ByteArrayProperty vendorExtension(String key, Object obj) {
32+
this.setVendorExtension(key, obj);
33+
return this;
34+
}
2935
}

modules/swagger-models/src/main/java/io/swagger/models/properties/DateProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public DateProperty example(String example) {
4646
return this;
4747
}
4848

49+
public DateProperty vendorExtension(String key, Object obj) {
50+
this.setVendorExtension(key, obj);
51+
return this;
52+
}
53+
4954
public List<String> getEnum() {
5055
return _enum;
5156
}

modules/swagger-models/src/main/java/io/swagger/models/properties/DateTimeProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public DateTimeProperty example(String example) {
4646
return this;
4747
}
4848

49+
public DateTimeProperty vendorExtension(String key, Object obj) {
50+
this.setVendorExtension(key, obj);
51+
return this;
52+
}
53+
4954
public List<String> getEnum() {
5055
return _enum;
5156
}

modules/swagger-models/src/main/java/io/swagger/models/properties/DecimalProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,9 @@ public DecimalProperty example(String example) {
3434
this.setExample(example);
3535
return this;
3636
}
37+
38+
public DecimalProperty vendorExtension(String key, Object obj) {
39+
this.setVendorExtension(key, obj);
40+
return this;
41+
}
3742
}

modules/swagger-models/src/main/java/io/swagger/models/properties/DoubleProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public DoubleProperty _default(Double _default) {
5959
return this;
6060
}
6161

62+
public DoubleProperty vendorExtension(String key, Object obj) {
63+
this.setVendorExtension(key, obj);
64+
return this;
65+
}
66+
6267
public Double getDefault() {
6368
return _default;
6469
}

modules/swagger-models/src/main/java/io/swagger/models/properties/EmailProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,9 @@ public EmailProperty pattern(String pattern) {
7878
super.pattern(pattern);
7979
return this;
8080
}
81+
82+
public EmailProperty vendorExtension(String key, Object obj) {
83+
this.setVendorExtension(key, obj);
84+
return this;
85+
}
8186
}

modules/swagger-models/src/main/java/io/swagger/models/properties/FloatProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ public FloatProperty _default(Float _default) {
6060
return this;
6161
}
6262

63+
public FloatProperty vendorExtension(String key, Object obj) {
64+
this.setVendorExtension(key, obj);
65+
return this;
66+
}
67+
6368
public Float getDefault() {
6469
return _default;
6570
}

0 commit comments

Comments
 (0)