forked from loafle/openapi-generator-original
Add support for read-only values in spring model (#4629)
This commit is contained in:
committed by
wing328
parent
6e2ee4be06
commit
78f38f1a1f
@@ -64,7 +64,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
|
|||||||
{{#vendorExtensions.extraAnnotation}}
|
{{#vendorExtensions.extraAnnotation}}
|
||||||
{{{vendorExtensions.extraAnnotation}}}
|
{{{vendorExtensions.extraAnnotation}}}
|
||||||
{{/vendorExtensions.extraAnnotation}}
|
{{/vendorExtensions.extraAnnotation}}
|
||||||
@ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
|
@ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}")
|
||||||
public {{{datatypeWithEnum}}} {{getter}}() {
|
public {{{datatypeWithEnum}}} {{getter}}() {
|
||||||
return {{name}};
|
return {{name}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getFoo() {
|
public String getFoo() {
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class Name {
|
|||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer getSnakeCase() {
|
public Integer getSnakeCase() {
|
||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ public class Name {
|
|||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer get123Number() {
|
public Integer get123Number() {
|
||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class ReadOnlyFirst {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getFoo() {
|
public String getFoo() {
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class Name {
|
|||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer getSnakeCase() {
|
public Integer getSnakeCase() {
|
||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ public class Name {
|
|||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer get123Number() {
|
public Integer get123Number() {
|
||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class ReadOnlyFirst {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getFoo() {
|
public String getFoo() {
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class Name {
|
|||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer getSnakeCase() {
|
public Integer getSnakeCase() {
|
||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ public class Name {
|
|||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer get123Number() {
|
public Integer get123Number() {
|
||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class ReadOnlyFirst {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getFoo() {
|
public String getFoo() {
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class Name {
|
|||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer getSnakeCase() {
|
public Integer getSnakeCase() {
|
||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ public class Name {
|
|||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer get123Number() {
|
public Integer get123Number() {
|
||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class ReadOnlyFirst {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ public class HasOnlyReadOnly {
|
|||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getFoo() {
|
public String getFoo() {
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class Name {
|
|||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer getSnakeCase() {
|
public Integer getSnakeCase() {
|
||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ public class Name {
|
|||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public Integer get123Number() {
|
public Integer get123Number() {
|
||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class ReadOnlyFirst {
|
|||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(readOnly = true, value = "")
|
||||||
public String getBar() {
|
public String getBar() {
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user