SingleRequestParameter setter parameter construction (#20679)

* Add so that the singleRequestParameter can be constructed one parameter at a time

* Replace the lombok EqualsAndHashcode with a mustache implementation

* Remove equals and hashcode from oneRequestParameter model

* Remove the final keyword from variables in the oneRequestParameter class
This commit is contained in:
Mattias Sehlstedt 2025-02-26 10:27:30 +01:00 committed by GitHub
parent 275107e3f1
commit 60bae732d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 559 additions and 141 deletions

View File

@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static. Only WebClient supports this option.| |false|
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false|
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|

View File

@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static. Only WebClient supports this option.| |false|
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false|
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|

View File

@ -236,7 +236,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newString(CONFIG_KEY_FROM_CLASS_NAME, "If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option."));
cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC + " Only jersey2, jersey3, native, okhttp-gson support this option."));
cliOptions.add(CliOption.newString(MICROPROFILE_REST_CLIENT_VERSION, "Version of MicroProfile Rest Client API."));
cliOptions.add(CliOption.newString(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, "Setting this property to \"true\" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to \"static\" does the same as \"true\", but also makes the generated arguments class static. Only WebClient supports this option.").defaultValue("false"));
cliOptions.add(CliOption.newString(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, "Setting this property to \"true\" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to \"static\" does the same as \"true\", but also makes the generated arguments class static with single parameter instantiation.").defaultValue("false"));
cliOptions.add(CliOption.newBoolean(WEBCLIENT_BLOCKING_OPERATIONS, "Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync", this.webclientBlockingOperations));
cliOptions.add(CliOption.newBoolean(GENERATE_CLIENT_AS_BEAN, "For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).", this.generateClientAsBean));
cliOptions.add(CliOption.newBoolean(SUPPORT_URL_QUERY, "Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries."));

View File

@ -56,7 +56,35 @@ public class {{classname}} {
{{#hasParams}}
{{^hasSingleParam}}
{{^staticRequest}}
public record {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){}
{{/staticRequest}}
{{#staticRequest}}
public static class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {
{{#allParams}}
private {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}};
{{/allParams}}
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request() {}
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {
{{#allParams}}
this.{{paramName}} = {{paramName}};
{{/allParams}}
}
{{#allParams}}
public {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}() {
return this.{{paramName}};
}
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {{paramName}}({{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}) {
this.{{paramName}} = {{paramName}};
return this;
}
{{/allParams}}
}
{{/staticRequest}}
/**
* {{summary}}

View File

@ -56,20 +56,27 @@ public class {{classname}} {
{{#operation}}{{#singleRequestParameter}}{{#hasParams}}{{^hasSingleParam}}
public {{#staticRequest}}static {{/staticRequest}}class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {
{{#allParams}}
private final {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}};
private {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}};
{{/allParams}}
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {
{{#allParams}}
this.{{paramName}} = {{paramName}};
{{/allParams}}
}
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request() {}
{{#allParams}}
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {
{{#allParams}}
this.{{paramName}} = {{paramName}};
{{/allParams}}
}
{{#allParams}}
public {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}() {
return this.{{paramName}};
}
{{/allParams}}
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {{paramName}}({{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}) {
this.{{paramName}} = {{paramName}};
return this;
}
{{/allParams}}
}
/**

View File

@ -3207,6 +3207,40 @@ public class JavaClientCodegenTest {
);
}
@Test
public void testRestClientWithUseSingleRequestParameter_static_issue_20668() {
final Path output = newTempFolder();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("java")
.setLibrary(JavaClientCodegen.RESTCLIENT)
.setAdditionalProperties(Map.of(
CodegenConstants.API_PACKAGE, "xyz.abcdef.api",
CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, "static"
))
.setInputSpec("src/test/resources/3_1/java/petstore.yaml")
.setOutputDir(output.toString().replace("\\", "/"));
new DefaultGenerator().opts(configurator.toClientOptInput()).generate();
TestUtils.assertFileContains(
output.resolve("src/main/java/xyz/abcdef/api/PetApi.java"),
"public static class DeletePetRequest {",
"DeletePetRequest(Long petId, String apiKey)",
"Long petId()",
"DeletePetRequest petId(Long petId) {",
"String apiKey()",
"DeletePetRequest apiKey(String apiKey) {",
"public void deletePet(DeletePetRequest requestParameters) throws RestClientResponseException {",
"public ResponseEntity<Void> deletePetWithHttpInfo(DeletePetRequest requestParameters) throws RestClientResponseException {",
"public ResponseSpec deletePetWithResponseSpec(DeletePetRequest requestParameters) throws RestClientResponseException {",
"public void deletePet(Long petId, String apiKey) throws RestClientResponseException {",
"public ResponseEntity<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientResponseException {",
"public ResponseSpec deletePetWithResponseSpec(Long petId, String apiKey) throws RestClientResponseException {"
);
TestUtils.assertFileNotContains(output.resolve("src/main/java/xyz/abcdef/api/PetApi.java"),
"public record DeletePetRequest(Long petId, String apiKey){}");
}
@Test
public void testDuplicatedOperationId() {
final Path output = newTempFolder();
@ -3244,7 +3278,8 @@ public class JavaClientCodegenTest {
);
}
@Test public void testWebClientWithUseSingleRequestParameter_issue_19407() {
@Test
public void testWebClientWithUseSingleRequestParameter_issue_19407() {
final Path output = newTempFolder();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("java")
@ -3302,6 +3337,38 @@ public class JavaClientCodegenTest {
);
}
@Test
public void testWebClientWithUseSingleRequestParameter_static_issue_20668() {
final Path output = newTempFolder();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("java")
.setLibrary(JavaClientCodegen.WEBCLIENT)
.setAdditionalProperties(Map.of(
CodegenConstants.API_PACKAGE, "xyz.abcdef.api",
CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, "static"
))
.setInputSpec("src/test/resources/3_1/java/petstore.yaml")
.setOutputDir(output.toString().replace("\\", "/"));
new DefaultGenerator().opts(configurator.toClientOptInput()).generate();
TestUtils.assertFileContains(
output.resolve("src/main/java/xyz/abcdef/api/PetApi.java"),
"public static class DeletePetRequest {",
"DeletePetRequest(Long petId, String apiKey)",
"Long petId()",
"DeletePetRequest petId(Long petId) {",
"String apiKey()",
"DeletePetRequest apiKey(String apiKey) {",
"public Mono<Void> deletePet(DeletePetRequest requestParameters) throws WebClientResponseException {",
"public Mono<ResponseEntity<Void>> deletePetWithHttpInfo(DeletePetRequest requestParameters) throws WebClientResponseException {",
"public ResponseSpec deletePetWithResponseSpec(DeletePetRequest requestParameters) throws WebClientResponseException {",
"public Mono<Void> deletePet(Long petId, String apiKey) throws WebClientResponseException {",
"public Mono<ResponseEntity<Void>> deletePetWithHttpInfo(Long petId, String apiKey) throws WebClientResponseException {",
"public ResponseSpec deletePetWithResponseSpec(Long petId, String apiKey) throws WebClientResponseException {"
);
}
@Test
public void testGenerateParameterId() {
final Path output = newTempFolder();

View File

@ -192,25 +192,42 @@ public class FakeApi {
}
public class FakeHttpSignatureTestRequest {
private final Pet pet;
private final String query1;
private final String header1;
private Pet pet;
private String query1;
private String header1;
public FakeHttpSignatureTestRequest() {}
public FakeHttpSignatureTestRequest(Pet pet, String query1, String header1) {
this.pet = pet;
this.query1 = query1;
this.header1 = header1;
}
this.pet = pet;
this.query1 = query1;
this.header1 = header1;
}
public Pet pet() {
return this.pet;
}
public FakeHttpSignatureTestRequest pet(Pet pet) {
this.pet = pet;
return this;
}
public String query1() {
return this.query1;
}
public FakeHttpSignatureTestRequest query1(String query1) {
this.query1 = query1;
return this;
}
public String header1() {
return this.header1;
}
public FakeHttpSignatureTestRequest header1(String header1) {
this.header1 = header1;
return this;
}
}
/**
@ -901,20 +918,32 @@ public class FakeApi {
}
public class TestBodyWithQueryParamsRequest {
private final String query;
private final User user;
private String query;
private User user;
public TestBodyWithQueryParamsRequest() {}
public TestBodyWithQueryParamsRequest(String query, User user) {
this.query = query;
this.user = user;
}
this.query = query;
this.user = user;
}
public String query() {
return this.query;
}
public TestBodyWithQueryParamsRequest query(String query) {
this.query = query;
return this;
}
public User user() {
return this.user;
}
public TestBodyWithQueryParamsRequest user(User user) {
this.user = user;
return this;
}
}
/**
@ -1108,80 +1137,152 @@ public class FakeApi {
}
public class TestEndpointParametersRequest {
private final BigDecimal number;
private final Double _double;
private final String patternWithoutDelimiter;
private final byte[] _byte;
private final Integer integer;
private final Integer int32;
private final Long int64;
private final Float _float;
private final String string;
private final File binary;
private final LocalDate date;
private final OffsetDateTime dateTime;
private final String password;
private final String paramCallback;
private BigDecimal number;
private Double _double;
private String patternWithoutDelimiter;
private byte[] _byte;
private Integer integer;
private Integer int32;
private Long int64;
private Float _float;
private String string;
private File binary;
private LocalDate date;
private OffsetDateTime dateTime;
private String password;
private String paramCallback;
public TestEndpointParametersRequest() {}
public TestEndpointParametersRequest(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) {
this.number = number;
this._double = _double;
this.patternWithoutDelimiter = patternWithoutDelimiter;
this._byte = _byte;
this.integer = integer;
this.int32 = int32;
this.int64 = int64;
this._float = _float;
this.string = string;
this.binary = binary;
this.date = date;
this.dateTime = dateTime;
this.password = password;
this.paramCallback = paramCallback;
}
this.number = number;
this._double = _double;
this.patternWithoutDelimiter = patternWithoutDelimiter;
this._byte = _byte;
this.integer = integer;
this.int32 = int32;
this.int64 = int64;
this._float = _float;
this.string = string;
this.binary = binary;
this.date = date;
this.dateTime = dateTime;
this.password = password;
this.paramCallback = paramCallback;
}
public BigDecimal number() {
return this.number;
}
public TestEndpointParametersRequest number(BigDecimal number) {
this.number = number;
return this;
}
public Double _double() {
return this._double;
}
public TestEndpointParametersRequest _double(Double _double) {
this._double = _double;
return this;
}
public String patternWithoutDelimiter() {
return this.patternWithoutDelimiter;
}
public TestEndpointParametersRequest patternWithoutDelimiter(String patternWithoutDelimiter) {
this.patternWithoutDelimiter = patternWithoutDelimiter;
return this;
}
public byte[] _byte() {
return this._byte;
}
public TestEndpointParametersRequest _byte(byte[] _byte) {
this._byte = _byte;
return this;
}
public Integer integer() {
return this.integer;
}
public TestEndpointParametersRequest integer(Integer integer) {
this.integer = integer;
return this;
}
public Integer int32() {
return this.int32;
}
public TestEndpointParametersRequest int32(Integer int32) {
this.int32 = int32;
return this;
}
public Long int64() {
return this.int64;
}
public TestEndpointParametersRequest int64(Long int64) {
this.int64 = int64;
return this;
}
public Float _float() {
return this._float;
}
public TestEndpointParametersRequest _float(Float _float) {
this._float = _float;
return this;
}
public String string() {
return this.string;
}
public TestEndpointParametersRequest string(String string) {
this.string = string;
return this;
}
public File binary() {
return this.binary;
}
public TestEndpointParametersRequest binary(File binary) {
this.binary = binary;
return this;
}
public LocalDate date() {
return this.date;
}
public TestEndpointParametersRequest date(LocalDate date) {
this.date = date;
return this;
}
public OffsetDateTime dateTime() {
return this.dateTime;
}
public TestEndpointParametersRequest dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
public String password() {
return this.password;
}
public TestEndpointParametersRequest password(String password) {
this.password = password;
return this;
}
public String paramCallback() {
return this.paramCallback;
}
public TestEndpointParametersRequest paramCallback(String paramCallback) {
this.paramCallback = paramCallback;
return this;
}
}
/**
@ -1390,55 +1491,102 @@ public class FakeApi {
}
public class TestEnumParametersRequest {
private final List<String> enumHeaderStringArray;
private final String enumHeaderString;
private final List<String> enumQueryStringArray;
private final String enumQueryString;
private final Integer enumQueryInteger;
private final Double enumQueryDouble;
private final List<EnumClass> enumQueryModelArray;
private final List<String> enumFormStringArray;
private final String enumFormString;
private List<String> enumHeaderStringArray;
private String enumHeaderString;
private List<String> enumQueryStringArray;
private String enumQueryString;
private Integer enumQueryInteger;
private Double enumQueryDouble;
private List<EnumClass> enumQueryModelArray;
private List<String> enumFormStringArray;
private String enumFormString;
public TestEnumParametersRequest() {}
public TestEnumParametersRequest(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<EnumClass> enumQueryModelArray, List<String> enumFormStringArray, String enumFormString) {
this.enumHeaderStringArray = enumHeaderStringArray;
this.enumHeaderString = enumHeaderString;
this.enumQueryStringArray = enumQueryStringArray;
this.enumQueryString = enumQueryString;
this.enumQueryInteger = enumQueryInteger;
this.enumQueryDouble = enumQueryDouble;
this.enumQueryModelArray = enumQueryModelArray;
this.enumFormStringArray = enumFormStringArray;
this.enumFormString = enumFormString;
}
this.enumHeaderStringArray = enumHeaderStringArray;
this.enumHeaderString = enumHeaderString;
this.enumQueryStringArray = enumQueryStringArray;
this.enumQueryString = enumQueryString;
this.enumQueryInteger = enumQueryInteger;
this.enumQueryDouble = enumQueryDouble;
this.enumQueryModelArray = enumQueryModelArray;
this.enumFormStringArray = enumFormStringArray;
this.enumFormString = enumFormString;
}
public List<String> enumHeaderStringArray() {
return this.enumHeaderStringArray;
}
public TestEnumParametersRequest enumHeaderStringArray(List<String> enumHeaderStringArray) {
this.enumHeaderStringArray = enumHeaderStringArray;
return this;
}
public String enumHeaderString() {
return this.enumHeaderString;
}
public TestEnumParametersRequest enumHeaderString(String enumHeaderString) {
this.enumHeaderString = enumHeaderString;
return this;
}
public List<String> enumQueryStringArray() {
return this.enumQueryStringArray;
}
public TestEnumParametersRequest enumQueryStringArray(List<String> enumQueryStringArray) {
this.enumQueryStringArray = enumQueryStringArray;
return this;
}
public String enumQueryString() {
return this.enumQueryString;
}
public TestEnumParametersRequest enumQueryString(String enumQueryString) {
this.enumQueryString = enumQueryString;
return this;
}
public Integer enumQueryInteger() {
return this.enumQueryInteger;
}
public TestEnumParametersRequest enumQueryInteger(Integer enumQueryInteger) {
this.enumQueryInteger = enumQueryInteger;
return this;
}
public Double enumQueryDouble() {
return this.enumQueryDouble;
}
public TestEnumParametersRequest enumQueryDouble(Double enumQueryDouble) {
this.enumQueryDouble = enumQueryDouble;
return this;
}
public List<EnumClass> enumQueryModelArray() {
return this.enumQueryModelArray;
}
public TestEnumParametersRequest enumQueryModelArray(List<EnumClass> enumQueryModelArray) {
this.enumQueryModelArray = enumQueryModelArray;
return this;
}
public List<String> enumFormStringArray() {
return this.enumFormStringArray;
}
public TestEnumParametersRequest enumFormStringArray(List<String> enumFormStringArray) {
this.enumFormStringArray = enumFormStringArray;
return this;
}
public String enumFormString() {
return this.enumFormString;
}
public TestEnumParametersRequest enumFormString(String enumFormString) {
this.enumFormString = enumFormString;
return this;
}
}
/**
@ -1598,40 +1746,72 @@ public class FakeApi {
}
public class TestGroupParametersRequest {
private final Integer requiredStringGroup;
private final Boolean requiredBooleanGroup;
private final Long requiredInt64Group;
private final Integer stringGroup;
private final Boolean booleanGroup;
private final Long int64Group;
private Integer requiredStringGroup;
private Boolean requiredBooleanGroup;
private Long requiredInt64Group;
private Integer stringGroup;
private Boolean booleanGroup;
private Long int64Group;
public TestGroupParametersRequest() {}
public TestGroupParametersRequest(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) {
this.requiredStringGroup = requiredStringGroup;
this.requiredBooleanGroup = requiredBooleanGroup;
this.requiredInt64Group = requiredInt64Group;
this.stringGroup = stringGroup;
this.booleanGroup = booleanGroup;
this.int64Group = int64Group;
}
this.requiredStringGroup = requiredStringGroup;
this.requiredBooleanGroup = requiredBooleanGroup;
this.requiredInt64Group = requiredInt64Group;
this.stringGroup = stringGroup;
this.booleanGroup = booleanGroup;
this.int64Group = int64Group;
}
public Integer requiredStringGroup() {
return this.requiredStringGroup;
}
public TestGroupParametersRequest requiredStringGroup(Integer requiredStringGroup) {
this.requiredStringGroup = requiredStringGroup;
return this;
}
public Boolean requiredBooleanGroup() {
return this.requiredBooleanGroup;
}
public TestGroupParametersRequest requiredBooleanGroup(Boolean requiredBooleanGroup) {
this.requiredBooleanGroup = requiredBooleanGroup;
return this;
}
public Long requiredInt64Group() {
return this.requiredInt64Group;
}
public TestGroupParametersRequest requiredInt64Group(Long requiredInt64Group) {
this.requiredInt64Group = requiredInt64Group;
return this;
}
public Integer stringGroup() {
return this.stringGroup;
}
public TestGroupParametersRequest stringGroup(Integer stringGroup) {
this.stringGroup = stringGroup;
return this;
}
public Boolean booleanGroup() {
return this.booleanGroup;
}
public TestGroupParametersRequest booleanGroup(Boolean booleanGroup) {
this.booleanGroup = booleanGroup;
return this;
}
public Long int64Group() {
return this.int64Group;
}
public TestGroupParametersRequest int64Group(Long int64Group) {
this.int64Group = int64Group;
return this;
}
}
/**
@ -1916,20 +2096,32 @@ public class FakeApi {
}
public class TestJsonFormDataRequest {
private final String param;
private final String param2;
private String param;
private String param2;
public TestJsonFormDataRequest() {}
public TestJsonFormDataRequest(String param, String param2) {
this.param = param;
this.param2 = param2;
}
this.param = param;
this.param2 = param2;
}
public String param() {
return this.param;
}
public TestJsonFormDataRequest param(String param) {
this.param = param;
return this;
}
public String param2() {
return this.param2;
}
public TestJsonFormDataRequest param2(String param2) {
this.param2 = param2;
return this;
}
}
/**
@ -2121,45 +2313,82 @@ public class FakeApi {
}
public class TestQueryParameterCollectionFormatRequest {
private final List<String> pipe;
private final List<String> ioutil;
private final List<String> http;
private final List<String> url;
private final List<String> context;
private final String allowEmpty;
private final Map<String, String> language;
private List<String> pipe;
private List<String> ioutil;
private List<String> http;
private List<String> url;
private List<String> context;
private String allowEmpty;
private Map<String, String> language;
public TestQueryParameterCollectionFormatRequest() {}
public TestQueryParameterCollectionFormatRequest(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context, String allowEmpty, Map<String, String> language) {
this.pipe = pipe;
this.ioutil = ioutil;
this.http = http;
this.url = url;
this.context = context;
this.allowEmpty = allowEmpty;
this.language = language;
}
this.pipe = pipe;
this.ioutil = ioutil;
this.http = http;
this.url = url;
this.context = context;
this.allowEmpty = allowEmpty;
this.language = language;
}
public List<String> pipe() {
return this.pipe;
}
public TestQueryParameterCollectionFormatRequest pipe(List<String> pipe) {
this.pipe = pipe;
return this;
}
public List<String> ioutil() {
return this.ioutil;
}
public TestQueryParameterCollectionFormatRequest ioutil(List<String> ioutil) {
this.ioutil = ioutil;
return this;
}
public List<String> http() {
return this.http;
}
public TestQueryParameterCollectionFormatRequest http(List<String> http) {
this.http = http;
return this;
}
public List<String> url() {
return this.url;
}
public TestQueryParameterCollectionFormatRequest url(List<String> url) {
this.url = url;
return this;
}
public List<String> context() {
return this.context;
}
public TestQueryParameterCollectionFormatRequest context(List<String> context) {
this.context = context;
return this;
}
public String allowEmpty() {
return this.allowEmpty;
}
public TestQueryParameterCollectionFormatRequest allowEmpty(String allowEmpty) {
this.allowEmpty = allowEmpty;
return this;
}
public Map<String, String> language() {
return this.language;
}
public TestQueryParameterCollectionFormatRequest language(Map<String, String> language) {
this.language = language;
return this;
}
}
/**

View File

@ -125,20 +125,32 @@ public class PetApi {
}
public class DeletePetRequest {
private final Long petId;
private final String apiKey;
private Long petId;
private String apiKey;
public DeletePetRequest() {}
public DeletePetRequest(Long petId, String apiKey) {
this.petId = petId;
this.apiKey = apiKey;
}
this.petId = petId;
this.apiKey = apiKey;
}
public Long petId() {
return this.petId;
}
public DeletePetRequest petId(Long petId) {
this.petId = petId;
return this;
}
public String apiKey() {
return this.apiKey;
}
public DeletePetRequest apiKey(String apiKey) {
this.apiKey = apiKey;
return this;
}
}
/**
@ -586,25 +598,42 @@ public class PetApi {
}
public class UpdatePetWithFormRequest {
private final Long petId;
private final String name;
private final String status;
private Long petId;
private String name;
private String status;
public UpdatePetWithFormRequest() {}
public UpdatePetWithFormRequest(Long petId, String name, String status) {
this.petId = petId;
this.name = name;
this.status = status;
}
this.petId = petId;
this.name = name;
this.status = status;
}
public Long petId() {
return this.petId;
}
public UpdatePetWithFormRequest petId(Long petId) {
this.petId = petId;
return this;
}
public String name() {
return this.name;
}
public UpdatePetWithFormRequest name(String name) {
this.name = name;
return this;
}
public String status() {
return this.status;
}
public UpdatePetWithFormRequest status(String status) {
this.status = status;
return this;
}
}
/**
@ -735,25 +764,42 @@ public class PetApi {
}
public class UploadFileRequest {
private final Long petId;
private final String additionalMetadata;
private final File _file;
private Long petId;
private String additionalMetadata;
private File _file;
public UploadFileRequest() {}
public UploadFileRequest(Long petId, String additionalMetadata, File _file) {
this.petId = petId;
this.additionalMetadata = additionalMetadata;
this._file = _file;
}
this.petId = petId;
this.additionalMetadata = additionalMetadata;
this._file = _file;
}
public Long petId() {
return this.petId;
}
public UploadFileRequest petId(Long petId) {
this.petId = petId;
return this;
}
public String additionalMetadata() {
return this.additionalMetadata;
}
public UploadFileRequest additionalMetadata(String additionalMetadata) {
this.additionalMetadata = additionalMetadata;
return this;
}
public File _file() {
return this._file;
}
public UploadFileRequest _file(File _file) {
this._file = _file;
return this;
}
}
/**
@ -884,25 +930,42 @@ public class PetApi {
}
public class UploadFileWithRequiredFileRequest {
private final Long petId;
private final File requiredFile;
private final String additionalMetadata;
private Long petId;
private File requiredFile;
private String additionalMetadata;
public UploadFileWithRequiredFileRequest() {}
public UploadFileWithRequiredFileRequest(Long petId, File requiredFile, String additionalMetadata) {
this.petId = petId;
this.requiredFile = requiredFile;
this.additionalMetadata = additionalMetadata;
}
this.petId = petId;
this.requiredFile = requiredFile;
this.additionalMetadata = additionalMetadata;
}
public Long petId() {
return this.petId;
}
public UploadFileWithRequiredFileRequest petId(Long petId) {
this.petId = petId;
return this;
}
public File requiredFile() {
return this.requiredFile;
}
public UploadFileWithRequiredFileRequest requiredFile(File requiredFile) {
this.requiredFile = requiredFile;
return this;
}
public String additionalMetadata() {
return this.additionalMetadata;
}
public UploadFileWithRequiredFileRequest additionalMetadata(String additionalMetadata) {
this.additionalMetadata = additionalMetadata;
return this;
}
}
/**

View File

@ -416,20 +416,32 @@ public class UserApi {
}
public class LoginUserRequest {
private final String username;
private final String password;
private String username;
private String password;
public LoginUserRequest() {}
public LoginUserRequest(String username, String password) {
this.username = username;
this.password = password;
}
this.username = username;
this.password = password;
}
public String username() {
return this.username;
}
public LoginUserRequest username(String username) {
this.username = username;
return this;
}
public String password() {
return this.password;
}
public LoginUserRequest password(String password) {
this.password = password;
return this;
}
}
/**
@ -621,20 +633,32 @@ public class UserApi {
}
public class UpdateUserRequest {
private final String username;
private final User user;
private String username;
private User user;
public UpdateUserRequest() {}
public UpdateUserRequest(String username, User user) {
this.username = username;
this.user = user;
}
this.username = username;
this.user = user;
}
public String username() {
return this.username;
}
public UpdateUserRequest username(String username) {
this.username = username;
return this;
}
public User user() {
return this.user;
}
public UpdateUserRequest user(User user) {
this.user = user;
return this;
}
}
/**