[Java] Sync jersey2 jersey3 template (#18281)

* sync jersey2 and 3 templates

* add deprecated

* update samples
This commit is contained in:
William Cheng
2024-04-03 16:32:39 +08:00
committed by GitHub
parent 2934f5ac51
commit 88204b247a
27 changed files with 312 additions and 434 deletions

View File

@@ -883,7 +883,7 @@ public class ApiClient extends JavaTimeFormatter {
File file = (File) param.getValue();
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
.fileName(file.getName()).size(file.length()).build();
// Attempt to probe the content type for the file so that the form part is more correctly
// and precisely identified, but fall back to application/octet-stream if that fails.
MediaType type;
@@ -892,7 +892,7 @@ public class ApiClient extends JavaTimeFormatter {
} catch (IOException | IllegalArgumentException e) {
type = MediaType.APPLICATION_OCTET_STREAM_TYPE;
}
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type));
} else {
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();

View File

@@ -99,6 +99,7 @@ public class Pet {
}
public static final String JSON_PROPERTY_STATUS = "status";
@Deprecated
private StatusEnum status;
public Pet() {
@@ -250,6 +251,7 @@ public class Pet {
}
@Deprecated
public Pet status(StatusEnum status) {
this.status = status;
return this;
@@ -271,6 +273,7 @@ public class Pet {
}
@Deprecated
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStatus(StatusEnum status) {