From 822234dd7614b1d6f26e94c40bb908400fc90ad7 Mon Sep 17 00:00:00 2001 From: Karol Dudzinski <33879397+tsiq-karold@users.noreply.github.com> Date: Sun, 31 Mar 2019 10:11:26 +0100 Subject: [PATCH] Generate setters for readonly properties in server code (#1582) * generate setters for readonly properties in server code * rollback DefaultGenerator change and remove isReadOnly tags from jaxrs server template * updating petstore * more petstore updates --- .../src/main/resources/JavaJaxRS/pojo.mustache | 6 +----- .../org/openapitools/model/EnumArrays.java | 2 +- .../openapitools/model/HasOnlyReadOnly.java | 18 ++++++++++++++++++ .../java/org/openapitools/model/MapTest.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 18 ++++++++++++++++++ .../org/openapitools/model/ReadOnlyFirst.java | 9 +++++++++ .../org/openapitools/model/EnumArrays.java | 2 +- .../openapitools/model/HasOnlyReadOnly.java | 18 ++++++++++++++++++ .../org/openapitools/model/InlineObject2.java | 2 +- .../java/org/openapitools/model/MapTest.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 18 ++++++++++++++++++ .../org/openapitools/model/ReadOnlyFirst.java | 9 +++++++++ .../org/openapitools/model/EnumArrays.java | 2 +- .../openapitools/model/HasOnlyReadOnly.java | 18 ++++++++++++++++++ .../java/org/openapitools/model/MapTest.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 18 ++++++++++++++++++ .../org/openapitools/model/ReadOnlyFirst.java | 9 +++++++++ .../org/openapitools/model/EnumArrays.java | 2 +- .../openapitools/model/HasOnlyReadOnly.java | 18 ++++++++++++++++++ .../java/org/openapitools/model/MapTest.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 18 ++++++++++++++++++ .../org/openapitools/model/ReadOnlyFirst.java | 9 +++++++++ .../org/openapitools/model/EnumArrays.java | 2 +- .../openapitools/model/HasOnlyReadOnly.java | 18 ++++++++++++++++++ .../java/org/openapitools/model/MapTest.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 18 ++++++++++++++++++ .../org/openapitools/model/ReadOnlyFirst.java | 9 +++++++++ .../org/openapitools/model/EnumArrays.java | 2 +- .../openapitools/model/HasOnlyReadOnly.java | 18 ++++++++++++++++++ .../java/org/openapitools/model/MapTest.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 18 ++++++++++++++++++ .../org/openapitools/model/ReadOnlyFirst.java | 9 +++++++++ 32 files changed, 284 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index 15e243ef808a..86cae3fc71ba 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -11,7 +11,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/isContainer}} {{#isContainer}} {{#mostInnerItems}} -{{>enumClass}} +{{>enumClass}} {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} @@ -30,7 +30,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} {{#vars}} - {{^isReadOnly}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; return this; @@ -60,7 +59,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali } {{/isMapContainer}} - {{/isReadOnly}} /** {{#description}} * {{description}} @@ -87,12 +85,10 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } - {{^isReadOnly}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } - {{/isReadOnly}} {{/vars}} diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java index 9f2a4c2d988b..1b14f89a2912 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java @@ -94,7 +94,7 @@ public static ArrayEnumEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("array_enum") private List arrayEnum = null; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 6707536246b9..cbc031174973 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -33,6 +33,11 @@ public class HasOnlyReadOnly implements Serializable { @JsonProperty("foo") private String foo; + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -44,6 +49,15 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + /** * Get foo * @return foo @@ -55,6 +69,10 @@ public String getFoo() { return foo; } + public void setFoo(String foo) { + this.foo = foo; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java index 479db547303a..c71ad3216182 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java @@ -64,7 +64,7 @@ public static InnerEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java index 7f30b89dec19..47eaf106710f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java @@ -60,6 +60,11 @@ public void setName(Integer name) { this.name = name; } + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + /** * Get snakeCase * @return snakeCase @@ -71,6 +76,10 @@ public Integer getSnakeCase() { return snakeCase; } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + public Name property(String property) { this.property = property; return this; @@ -91,6 +100,11 @@ public void setProperty(String property) { this.property = property; } + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + /** * Get _123number * @return _123number @@ -102,6 +116,10 @@ public Integer get123number() { return _123number; } + public void set123number(Integer _123number) { + this._123number = _123number; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 46ca8d946ff2..440dd6587325 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -33,6 +33,11 @@ public class ReadOnlyFirst implements Serializable { @JsonProperty("baz") private String baz; + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -44,6 +49,10 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java index acbc56357469..b5fc2383e410 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java @@ -93,7 +93,7 @@ public static ArrayEnumEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("array_enum") private List arrayEnum = null; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 5b4ba5936e4a..7c17c4affe6c 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -32,6 +32,11 @@ public class HasOnlyReadOnly { @JsonProperty("foo") private String foo; + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,15 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + /** * Get foo * @return foo @@ -54,6 +68,10 @@ public String getFoo() { return foo; } + public void setFoo(String foo) { + this.foo = foo; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java index 856f819833c6..e1848f336f5e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java @@ -59,7 +59,7 @@ public static EnumFormStringArrayEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("enum_form_string_array") private List enumFormStringArray = null; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java index 50f3adad83f2..4a6c29e28217 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java @@ -63,7 +63,7 @@ public static InnerEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java index c3bf4b7d0bd2..8e2ac8a40261 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java @@ -59,6 +59,11 @@ public void setName(Integer name) { this.name = name; } + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + /** * Get snakeCase * @return snakeCase @@ -70,6 +75,10 @@ public Integer getSnakeCase() { return snakeCase; } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + public Name property(String property) { this.property = property; return this; @@ -90,6 +99,11 @@ public void setProperty(String property) { this.property = property; } + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + /** * Get _123number * @return _123number @@ -101,6 +115,10 @@ public Integer get123number() { return _123number; } + public void set123number(Integer _123number) { + this._123number = _123number; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index a961d7518d3c..806b53b499ff 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -32,6 +32,11 @@ public class ReadOnlyFirst { @JsonProperty("baz") private String baz; + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,10 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index acbc56357469..b5fc2383e410 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -93,7 +93,7 @@ public static ArrayEnumEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("array_enum") private List arrayEnum = null; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 5b4ba5936e4a..7c17c4affe6c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -32,6 +32,11 @@ public class HasOnlyReadOnly { @JsonProperty("foo") private String foo; + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,15 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + /** * Get foo * @return foo @@ -54,6 +68,10 @@ public String getFoo() { return foo; } + public void setFoo(String foo) { + this.foo = foo; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java index 50f3adad83f2..4a6c29e28217 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -63,7 +63,7 @@ public static InnerEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java index c3bf4b7d0bd2..8e2ac8a40261 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java @@ -59,6 +59,11 @@ public void setName(Integer name) { this.name = name; } + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + /** * Get snakeCase * @return snakeCase @@ -70,6 +75,10 @@ public Integer getSnakeCase() { return snakeCase; } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + public Name property(String property) { this.property = property; return this; @@ -90,6 +99,11 @@ public void setProperty(String property) { this.property = property; } + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + /** * Get _123number * @return _123number @@ -101,6 +115,10 @@ public Integer get123number() { return _123number; } + public void set123number(Integer _123number) { + this._123number = _123number; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index a961d7518d3c..806b53b499ff 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -32,6 +32,11 @@ public class ReadOnlyFirst { @JsonProperty("baz") private String baz; + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,10 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java index acbc56357469..b5fc2383e410 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java @@ -93,7 +93,7 @@ public static ArrayEnumEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("array_enum") private List arrayEnum = null; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 5b4ba5936e4a..7c17c4affe6c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -32,6 +32,11 @@ public class HasOnlyReadOnly { @JsonProperty("foo") private String foo; + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,15 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + /** * Get foo * @return foo @@ -54,6 +68,10 @@ public String getFoo() { return foo; } + public void setFoo(String foo) { + this.foo = foo; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java index 50f3adad83f2..4a6c29e28217 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java @@ -63,7 +63,7 @@ public static InnerEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java index c3bf4b7d0bd2..8e2ac8a40261 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java @@ -59,6 +59,11 @@ public void setName(Integer name) { this.name = name; } + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + /** * Get snakeCase * @return snakeCase @@ -70,6 +75,10 @@ public Integer getSnakeCase() { return snakeCase; } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + public Name property(String property) { this.property = property; return this; @@ -90,6 +99,11 @@ public void setProperty(String property) { this.property = property; } + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + /** * Get _123number * @return _123number @@ -101,6 +115,10 @@ public Integer get123number() { return _123number; } + public void set123number(Integer _123number) { + this._123number = _123number; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index a961d7518d3c..806b53b499ff 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -32,6 +32,11 @@ public class ReadOnlyFirst { @JsonProperty("baz") private String baz; + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,10 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index acbc56357469..b5fc2383e410 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -93,7 +93,7 @@ public static ArrayEnumEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("array_enum") private List arrayEnum = null; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 5b4ba5936e4a..7c17c4affe6c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -32,6 +32,11 @@ public class HasOnlyReadOnly { @JsonProperty("foo") private String foo; + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,15 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + /** * Get foo * @return foo @@ -54,6 +68,10 @@ public String getFoo() { return foo; } + public void setFoo(String foo) { + this.foo = foo; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index 50f3adad83f2..4a6c29e28217 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -63,7 +63,7 @@ public static InnerEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java index c3bf4b7d0bd2..8e2ac8a40261 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java @@ -59,6 +59,11 @@ public void setName(Integer name) { this.name = name; } + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + /** * Get snakeCase * @return snakeCase @@ -70,6 +75,10 @@ public Integer getSnakeCase() { return snakeCase; } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + public Name property(String property) { this.property = property; return this; @@ -90,6 +99,11 @@ public void setProperty(String property) { this.property = property; } + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + /** * Get _123number * @return _123number @@ -101,6 +115,10 @@ public Integer get123number() { return _123number; } + public void set123number(Integer _123number) { + this._123number = _123number; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index a961d7518d3c..806b53b499ff 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -32,6 +32,11 @@ public class ReadOnlyFirst { @JsonProperty("baz") private String baz; + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,10 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java index acbc56357469..b5fc2383e410 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java @@ -93,7 +93,7 @@ public static ArrayEnumEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("array_enum") private List arrayEnum = null; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 5b4ba5936e4a..7c17c4affe6c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -32,6 +32,11 @@ public class HasOnlyReadOnly { @JsonProperty("foo") private String foo; + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,15 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + /** * Get foo * @return foo @@ -54,6 +68,10 @@ public String getFoo() { return foo; } + public void setFoo(String foo) { + this.foo = foo; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index 50f3adad83f2..4a6c29e28217 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -63,7 +63,7 @@ public static InnerEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java index c3bf4b7d0bd2..8e2ac8a40261 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java @@ -59,6 +59,11 @@ public void setName(Integer name) { this.name = name; } + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + /** * Get snakeCase * @return snakeCase @@ -70,6 +75,10 @@ public Integer getSnakeCase() { return snakeCase; } + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + public Name property(String property) { this.property = property; return this; @@ -90,6 +99,11 @@ public void setProperty(String property) { this.property = property; } + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + /** * Get _123number * @return _123number @@ -101,6 +115,10 @@ public Integer get123number() { return _123number; } + public void set123number(Integer _123number) { + this._123number = _123number; + } + @Override public boolean equals(java.lang.Object o) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index a961d7518d3c..806b53b499ff 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -32,6 +32,11 @@ public class ReadOnlyFirst { @JsonProperty("baz") private String baz; + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + /** * Get bar * @return bar @@ -43,6 +48,10 @@ public String getBar() { return bar; } + public void setBar(String bar) { + this.bar = bar; + } + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this;