Skip to content

Commit b8ef7bd

Browse files
committed
add nested object (#91)
(cherry picked from commit 4a20642)
1 parent aeb98d1 commit b8ef7bd

File tree

7 files changed

+61
-1
lines changed

7 files changed

+61
-1
lines changed

openapi-processor-core/src/testInt/resources/tests/map-from-additional-properties-with-package-name/inputs/openapi30.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ components:
4949
properties:
5050
text:
5151
type: string
52+
nested:
53+
$ref: '#/components/schemas/NestedValue'
54+
55+
NestedValue:
56+
type: object
57+
properties:
58+
text:
59+
type: string

openapi-processor-core/src/testInt/resources/tests/map-from-additional-properties-with-package-name/inputs/openapi31.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ components:
4949
properties:
5050
text:
5151
type: string
52+
nested:
53+
$ref: '#/components/schemas/NestedValue'
54+
55+
NestedValue:
56+
type: object
57+
properties:
58+
text:
59+
type: string
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
items:
22
- outputs/api/Api.java
33
- outputs/<model>/Value.java
4+
- outputs/<model>/NestedValue.java
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package generated.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public class NestedValue {
8+
9+
@JsonProperty("text")
10+
private String text;
11+
12+
public String getText() {
13+
return text;
14+
}
15+
16+
public void setText(String text) {
17+
this.text = text;
18+
}
19+
20+
}

openapi-processor-core/src/testInt/resources/tests/map-from-additional-properties-with-package-name/outputs/model/default/Value.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
import com.fasterxml.jackson.annotation.JsonProperty;
44
import generated.support.Generated;
5+
import javax.validation.Valid;
56

67
@Generated(value = "openapi-processor-core", version = "test")
78
public class Value {
89

910
@JsonProperty("text")
1011
private String text;
1112

13+
@Valid
14+
@JsonProperty("nested")
15+
private NestedValue nested;
16+
1217
public String getText() {
1318
return text;
1419
}
@@ -17,4 +22,12 @@ public void setText(String text) {
1722
this.text = text;
1823
}
1924

25+
public NestedValue getNested() {
26+
return nested;
27+
}
28+
29+
public void setNested(NestedValue nested) {
30+
this.nested = nested;
31+
}
32+
2033
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package generated.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public record NestedValue(@JsonProperty("text") String text) {
8+
}

openapi-processor-core/src/testInt/resources/tests/map-from-additional-properties-with-package-name/outputs/model/record/Value.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
import com.fasterxml.jackson.annotation.JsonProperty;
44
import generated.support.Generated;
5+
import javax.validation.Valid;
56

67
@Generated(value = "openapi-processor-core", version = "test")
7-
public record Value(@JsonProperty("text") String text) {
8+
public record Value(
9+
@JsonProperty("text") String text, @Valid @JsonProperty("nested") NestedValue nested) {
810
}

0 commit comments

Comments
 (0)