forked from loafle/openapi-generator-original
add back setter to spring model (readonly attr)
This commit is contained in:
parent
52736ddaeb
commit
4eb75f8088
@ -27,7 +27,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
|
|||||||
|
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
{{^isReadOnly}}
|
|
||||||
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
|
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
|
||||||
this.{{name}} = {{name}};
|
this.{{name}} = {{name}};
|
||||||
return this;
|
return this;
|
||||||
@ -47,7 +46,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
|
|||||||
}
|
}
|
||||||
{{/isMapContainer}}
|
{{/isMapContainer}}
|
||||||
|
|
||||||
{{/isReadOnly}}
|
|
||||||
/**
|
/**
|
||||||
{{#description}}
|
{{#description}}
|
||||||
* {{{description}}}
|
* {{{description}}}
|
||||||
@ -70,12 +68,10 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
|
|||||||
public {{{datatypeWithEnum}}} {{getter}}() {
|
public {{{datatypeWithEnum}}} {{getter}}() {
|
||||||
return {{name}};
|
return {{name}};
|
||||||
}
|
}
|
||||||
{{^isReadOnly}}
|
|
||||||
|
|
||||||
public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
|
public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
|
||||||
this.{{name}} = {{name}};
|
this.{{name}} = {{name}};
|
||||||
}
|
}
|
||||||
{{/isReadOnly}}
|
|
||||||
|
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.ModelApiResponse;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import io.swagger.model.ModelApiResponse;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.ModelApiResponse;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import io.swagger.model.ModelApiResponse;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Client;
|
import io.swagger.model.Client;
|
||||||
import java.time.OffsetDateTime;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.OffsetDateTime;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.ModelApiResponse;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import io.swagger.model.ModelApiResponse;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
@ -17,6 +17,11 @@ public class HasOnlyReadOnly {
|
|||||||
@JsonProperty("foo")
|
@JsonProperty("foo")
|
||||||
private String foo = null;
|
private String foo = null;
|
||||||
|
|
||||||
|
public HasOnlyReadOnly bar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
@ -26,6 +31,15 @@ public class HasOnlyReadOnly {
|
|||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HasOnlyReadOnly foo(String foo) {
|
||||||
|
this.foo = foo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
@ -35,6 +49,10 @@ public class HasOnlyReadOnly {
|
|||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFoo(String foo) {
|
||||||
|
this.foo = foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
|
@ -42,6 +42,11 @@ public class Name {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Name snakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
@ -51,6 +56,10 @@ public class Name {
|
|||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSnakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
}
|
||||||
|
|
||||||
public Name property(String property) {
|
public Name property(String property) {
|
||||||
this.property = property;
|
this.property = property;
|
||||||
return this;
|
return this;
|
||||||
@ -69,6 +78,11 @@ public class Name {
|
|||||||
this.property = property;
|
this.property = property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Name _123Number(Integer _123Number) {
|
||||||
|
this._123Number = _123Number;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
@ -78,6 +92,10 @@ public class Name {
|
|||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void set123Number(Integer _123Number) {
|
||||||
|
this._123Number = _123Number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
|
@ -17,6 +17,11 @@ public class ReadOnlyFirst {
|
|||||||
@JsonProperty("baz")
|
@JsonProperty("baz")
|
||||||
private String baz = null;
|
private String baz = null;
|
||||||
|
|
||||||
|
public ReadOnlyFirst bar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
@ -26,6 +31,10 @@ public class ReadOnlyFirst {
|
|||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
}
|
||||||
|
|
||||||
public ReadOnlyFirst baz(String baz) {
|
public ReadOnlyFirst baz(String baz) {
|
||||||
this.baz = baz;
|
this.baz = baz;
|
||||||
return this;
|
return this;
|
||||||
|
@ -2,8 +2,8 @@ package io.swagger.api;
|
|||||||
|
|
||||||
import io.swagger.model.Client;
|
import io.swagger.model.Client;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -2,8 +2,8 @@ package io.swagger.api;
|
|||||||
|
|
||||||
import io.swagger.model.Client;
|
import io.swagger.model.Client;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.ModelApiResponse;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import io.swagger.model.ModelApiResponse;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.ModelApiResponse;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import io.swagger.model.ModelApiResponse;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ -17,6 +17,11 @@ public class HasOnlyReadOnly {
|
|||||||
@JsonProperty("foo")
|
@JsonProperty("foo")
|
||||||
private String foo = null;
|
private String foo = null;
|
||||||
|
|
||||||
|
public HasOnlyReadOnly bar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
@ -26,6 +31,15 @@ public class HasOnlyReadOnly {
|
|||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HasOnlyReadOnly foo(String foo) {
|
||||||
|
this.foo = foo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
@ -35,6 +49,10 @@ public class HasOnlyReadOnly {
|
|||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFoo(String foo) {
|
||||||
|
this.foo = foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
|
@ -42,6 +42,11 @@ public class Name {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Name snakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
@ -51,6 +56,10 @@ public class Name {
|
|||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSnakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
}
|
||||||
|
|
||||||
public Name property(String property) {
|
public Name property(String property) {
|
||||||
this.property = property;
|
this.property = property;
|
||||||
return this;
|
return this;
|
||||||
@ -69,6 +78,11 @@ public class Name {
|
|||||||
this.property = property;
|
this.property = property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Name _123Number(Integer _123Number) {
|
||||||
|
this._123Number = _123Number;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
@ -78,6 +92,10 @@ public class Name {
|
|||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void set123Number(Integer _123Number) {
|
||||||
|
this._123Number = _123Number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
|
@ -17,6 +17,11 @@ public class ReadOnlyFirst {
|
|||||||
@JsonProperty("baz")
|
@JsonProperty("baz")
|
||||||
private String baz = null;
|
private String baz = null;
|
||||||
|
|
||||||
|
public ReadOnlyFirst bar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
@ -26,6 +31,10 @@ public class ReadOnlyFirst {
|
|||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
}
|
||||||
|
|
||||||
public ReadOnlyFirst baz(String baz) {
|
public ReadOnlyFirst baz(String baz) {
|
||||||
this.baz = baz;
|
this.baz = baz;
|
||||||
return this;
|
return this;
|
||||||
|
@ -2,8 +2,8 @@ package io.swagger.api;
|
|||||||
|
|
||||||
import io.swagger.model.Client;
|
import io.swagger.model.Client;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -2,8 +2,8 @@ package io.swagger.api;
|
|||||||
|
|
||||||
import io.swagger.model.Client;
|
import io.swagger.model.Client;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.ModelApiResponse;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import io.swagger.model.ModelApiResponse;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.ModelApiResponse;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import io.swagger.model.ModelApiResponse;
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
|
||||||
|
@ -17,6 +17,11 @@ public class HasOnlyReadOnly {
|
|||||||
@JsonProperty("foo")
|
@JsonProperty("foo")
|
||||||
private String foo = null;
|
private String foo = null;
|
||||||
|
|
||||||
|
public HasOnlyReadOnly bar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
@ -26,6 +31,15 @@ public class HasOnlyReadOnly {
|
|||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HasOnlyReadOnly foo(String foo) {
|
||||||
|
this.foo = foo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get foo
|
* Get foo
|
||||||
* @return foo
|
* @return foo
|
||||||
@ -35,6 +49,10 @@ public class HasOnlyReadOnly {
|
|||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFoo(String foo) {
|
||||||
|
this.foo = foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
|
@ -42,6 +42,11 @@ public class Name {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Name snakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get snakeCase
|
* Get snakeCase
|
||||||
* @return snakeCase
|
* @return snakeCase
|
||||||
@ -51,6 +56,10 @@ public class Name {
|
|||||||
return snakeCase;
|
return snakeCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSnakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
}
|
||||||
|
|
||||||
public Name property(String property) {
|
public Name property(String property) {
|
||||||
this.property = property;
|
this.property = property;
|
||||||
return this;
|
return this;
|
||||||
@ -69,6 +78,11 @@ public class Name {
|
|||||||
this.property = property;
|
this.property = property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Name _123Number(Integer _123Number) {
|
||||||
|
this._123Number = _123Number;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get _123Number
|
* Get _123Number
|
||||||
* @return _123Number
|
* @return _123Number
|
||||||
@ -78,6 +92,10 @@ public class Name {
|
|||||||
return _123Number;
|
return _123Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void set123Number(Integer _123Number) {
|
||||||
|
this._123Number = _123Number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(java.lang.Object o) {
|
public boolean equals(java.lang.Object o) {
|
||||||
|
@ -17,6 +17,11 @@ public class ReadOnlyFirst {
|
|||||||
@JsonProperty("baz")
|
@JsonProperty("baz")
|
||||||
private String baz = null;
|
private String baz = null;
|
||||||
|
|
||||||
|
public ReadOnlyFirst bar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get bar
|
* Get bar
|
||||||
* @return bar
|
* @return bar
|
||||||
@ -26,6 +31,10 @@ public class ReadOnlyFirst {
|
|||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setBar(String bar) {
|
||||||
|
this.bar = bar;
|
||||||
|
}
|
||||||
|
|
||||||
public ReadOnlyFirst baz(String baz) {
|
public ReadOnlyFirst baz(String baz) {
|
||||||
this.baz = baz;
|
this.baz = baz;
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user