[JAVA] Jersey3 deprecated field only deprecates getter method (#17221)

* Deprecate build and setter methods

* Generate samples
This commit is contained in:
Beppe Catanese
2023-11-29 14:54:17 +01:00
committed by GitHub
parent 9184560597
commit fd58539fe9
3 changed files with 53 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ public class ObjectWithDeprecatedFields {
}
@Deprecated
public ObjectWithDeprecatedFields id(BigDecimal id) {
this.id = id;
return this;
@@ -101,6 +102,7 @@ public class ObjectWithDeprecatedFields {
}
@Deprecated
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(BigDecimal id) {
@@ -108,6 +110,7 @@ public class ObjectWithDeprecatedFields {
}
@Deprecated
public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) {
this.deprecatedRef = deprecatedRef;
return this;
@@ -128,6 +131,7 @@ public class ObjectWithDeprecatedFields {
}
@Deprecated
@JsonProperty(JSON_PROPERTY_DEPRECATED_REF)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDeprecatedRef(DeprecatedObject deprecatedRef) {
@@ -135,6 +139,7 @@ public class ObjectWithDeprecatedFields {
}
@Deprecated
public ObjectWithDeprecatedFields bars(List<String> bars) {
this.bars = bars;
return this;
@@ -163,6 +168,7 @@ public class ObjectWithDeprecatedFields {
}
@Deprecated
@JsonProperty(JSON_PROPERTY_BARS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setBars(List<String> bars) {