Skip to content

Commit b61e603

Browse files
committed
Changed Apple and Banana to let petstore-openapi3-jersey2-java8 tests pass
1 parent a13798a commit b61e603

7 files changed

Lines changed: 6 additions & 168 deletions

File tree

modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,11 +1969,13 @@ components:
19691969
type: string
19701970
pattern: /^[A-Z\s]*$/i
19711971
nullable: true
1972+
additionalProperties: false
19721973
banana:
19731974
type: object
19741975
properties:
19751976
lengthCm:
19761977
type: number
1978+
additionalProperties: false
19771979
mammal:
19781980
oneOf:
19791981
- $ref: '#/components/schemas/whale'

samples/client/petstore/java/jersey3/api/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,7 @@ components:
20382038
color:
20392039
type: string
20402040
apple:
2041+
additionalProperties: false
20412042
nullable: true
20422043
properties:
20432044
cultivar:
@@ -2048,6 +2049,7 @@ components:
20482049
type: string
20492050
type: object
20502051
banana:
2052+
additionalProperties: false
20512053
properties:
20522054
lengthCm:
20532055
type: number

samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
import org.apache.commons.lang3.builder.EqualsBuilder;
1717
import org.apache.commons.lang3.builder.HashCodeBuilder;
18-
import java.util.Map;
19-
import java.util.HashMap;
20-
import com.fasterxml.jackson.annotation.JsonAnyGetter;
21-
import com.fasterxml.jackson.annotation.JsonAnySetter;
2218
import java.util.Objects;
2319
import java.util.Map;
2420
import java.util.HashMap;
@@ -106,43 +102,6 @@ public void setOrigin(@jakarta.annotation.Nullable String origin) {
106102
this.origin = origin;
107103
}
108104

109-
/**
110-
* A container for additional, undeclared properties.
111-
* This is a holder for any undeclared properties as specified with
112-
* the 'additionalProperties' keyword in the OAS document.
113-
*/
114-
private Map<String, Object> additionalProperties;
115-
116-
/**
117-
* Set the additional (undeclared) property with the specified name and value.
118-
* If the property does not already exist, create it otherwise replace it.
119-
*/
120-
@JsonAnySetter
121-
public Apple putAdditionalProperty(String key, Object value) {
122-
if (this.additionalProperties == null) {
123-
this.additionalProperties = new HashMap<>();
124-
}
125-
this.additionalProperties.put(key, value);
126-
return this;
127-
}
128-
129-
/**
130-
* Return the additional (undeclared) property.
131-
*/
132-
@JsonAnyGetter
133-
public Map<String, Object> getAdditionalProperties() {
134-
return additionalProperties;
135-
}
136-
137-
/**
138-
* Return the additional (undeclared) property with the specified name.
139-
*/
140-
public Object getAdditionalProperty(String key) {
141-
if (this.additionalProperties == null) {
142-
return null;
143-
}
144-
return this.additionalProperties.get(key);
145-
}
146105

147106
/**
148107
* Return true if this apple object is equal to o.
@@ -163,7 +122,6 @@ public String toString() {
163122
sb.append("class Apple {\n");
164123
sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n");
165124
sb.append(" origin: ").append(toIndentedString(origin)).append("\n");
166-
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
167125
sb.append("}");
168126
return sb.toString();
169127
}

samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Banana.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
import org.apache.commons.lang3.builder.EqualsBuilder;
1717
import org.apache.commons.lang3.builder.HashCodeBuilder;
18-
import java.util.Map;
19-
import java.util.HashMap;
20-
import com.fasterxml.jackson.annotation.JsonAnyGetter;
21-
import com.fasterxml.jackson.annotation.JsonAnySetter;
2218
import java.util.Objects;
2319
import java.util.Map;
2420
import java.util.HashMap;
@@ -77,43 +73,6 @@ public void setLengthCm(@jakarta.annotation.Nullable BigDecimal lengthCm) {
7773
this.lengthCm = lengthCm;
7874
}
7975

80-
/**
81-
* A container for additional, undeclared properties.
82-
* This is a holder for any undeclared properties as specified with
83-
* the 'additionalProperties' keyword in the OAS document.
84-
*/
85-
private Map<String, Object> additionalProperties;
86-
87-
/**
88-
* Set the additional (undeclared) property with the specified name and value.
89-
* If the property does not already exist, create it otherwise replace it.
90-
*/
91-
@JsonAnySetter
92-
public Banana putAdditionalProperty(String key, Object value) {
93-
if (this.additionalProperties == null) {
94-
this.additionalProperties = new HashMap<>();
95-
}
96-
this.additionalProperties.put(key, value);
97-
return this;
98-
}
99-
100-
/**
101-
* Return the additional (undeclared) property.
102-
*/
103-
@JsonAnyGetter
104-
public Map<String, Object> getAdditionalProperties() {
105-
return additionalProperties;
106-
}
107-
108-
/**
109-
* Return the additional (undeclared) property with the specified name.
110-
*/
111-
public Object getAdditionalProperty(String key) {
112-
if (this.additionalProperties == null) {
113-
return null;
114-
}
115-
return this.additionalProperties.get(key);
116-
}
11776

11877
/**
11978
* Return true if this banana object is equal to o.
@@ -133,7 +92,6 @@ public String toString() {
13392
StringBuilder sb = new StringBuilder();
13493
sb.append("class Banana {\n");
13594
sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n");
136-
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
13795
sb.append("}");
13896
return sb.toString();
13997
}

samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,7 @@ components:
20382038
color:
20392039
type: string
20402040
apple:
2041+
additionalProperties: false
20412042
nullable: true
20422043
properties:
20432044
cultivar:
@@ -2048,6 +2049,7 @@ components:
20482049
type: string
20492050
type: object
20502051
banana:
2052+
additionalProperties: false
20512053
properties:
20522054
lengthCm:
20532055
type: number

samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
import org.apache.commons.lang3.builder.EqualsBuilder;
1717
import org.apache.commons.lang3.builder.HashCodeBuilder;
18-
import java.util.Map;
19-
import java.util.HashMap;
20-
import com.fasterxml.jackson.annotation.JsonAnyGetter;
21-
import com.fasterxml.jackson.annotation.JsonAnySetter;
2218
import java.util.Objects;
2319
import java.util.Map;
2420
import java.util.HashMap;
@@ -102,43 +98,6 @@ public void setOrigin(@javax.annotation.Nullable String origin) {
10298
this.origin = origin;
10399
}
104100

105-
/**
106-
* A container for additional, undeclared properties.
107-
* This is a holder for any undeclared properties as specified with
108-
* the 'additionalProperties' keyword in the OAS document.
109-
*/
110-
private Map<String, Object> additionalProperties;
111-
112-
/**
113-
* Set the additional (undeclared) property with the specified name and value.
114-
* If the property does not already exist, create it otherwise replace it.
115-
*/
116-
@JsonAnySetter
117-
public Apple putAdditionalProperty(String key, Object value) {
118-
if (this.additionalProperties == null) {
119-
this.additionalProperties = new HashMap<>();
120-
}
121-
this.additionalProperties.put(key, value);
122-
return this;
123-
}
124-
125-
/**
126-
* Return the additional (undeclared) property.
127-
*/
128-
@JsonAnyGetter
129-
public Map<String, Object> getAdditionalProperties() {
130-
return additionalProperties;
131-
}
132-
133-
/**
134-
* Return the additional (undeclared) property with the specified name.
135-
*/
136-
public Object getAdditionalProperty(String key) {
137-
if (this.additionalProperties == null) {
138-
return null;
139-
}
140-
return this.additionalProperties.get(key);
141-
}
142101

143102
/**
144103
* Return true if this apple object is equal to o.
@@ -159,7 +118,6 @@ public String toString() {
159118
sb.append("class Apple {\n");
160119
sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n");
161120
sb.append(" origin: ").append(toIndentedString(origin)).append("\n");
162-
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
163121
sb.append("}");
164122
return sb.toString();
165123
}

samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
import org.apache.commons.lang3.builder.EqualsBuilder;
1717
import org.apache.commons.lang3.builder.HashCodeBuilder;
18-
import java.util.Map;
19-
import java.util.HashMap;
20-
import com.fasterxml.jackson.annotation.JsonAnyGetter;
21-
import com.fasterxml.jackson.annotation.JsonAnySetter;
2218
import java.util.Objects;
2319
import java.util.Map;
2420
import java.util.HashMap;
@@ -73,43 +69,6 @@ public void setLengthCm(@javax.annotation.Nullable BigDecimal lengthCm) {
7369
this.lengthCm = lengthCm;
7470
}
7571

76-
/**
77-
* A container for additional, undeclared properties.
78-
* This is a holder for any undeclared properties as specified with
79-
* the 'additionalProperties' keyword in the OAS document.
80-
*/
81-
private Map<String, Object> additionalProperties;
82-
83-
/**
84-
* Set the additional (undeclared) property with the specified name and value.
85-
* If the property does not already exist, create it otherwise replace it.
86-
*/
87-
@JsonAnySetter
88-
public Banana putAdditionalProperty(String key, Object value) {
89-
if (this.additionalProperties == null) {
90-
this.additionalProperties = new HashMap<>();
91-
}
92-
this.additionalProperties.put(key, value);
93-
return this;
94-
}
95-
96-
/**
97-
* Return the additional (undeclared) property.
98-
*/
99-
@JsonAnyGetter
100-
public Map<String, Object> getAdditionalProperties() {
101-
return additionalProperties;
102-
}
103-
104-
/**
105-
* Return the additional (undeclared) property with the specified name.
106-
*/
107-
public Object getAdditionalProperty(String key) {
108-
if (this.additionalProperties == null) {
109-
return null;
110-
}
111-
return this.additionalProperties.get(key);
112-
}
11372

11473
/**
11574
* Return true if this banana object is equal to o.
@@ -129,7 +88,6 @@ public String toString() {
12988
StringBuilder sb = new StringBuilder();
13089
sb.append("class Banana {\n");
13190
sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n");
132-
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
13391
sb.append("}");
13492
return sb.toString();
13593
}

0 commit comments

Comments
 (0)