forked from loafle/openapi-generator-original
Avoid using import mapping in model generation (#11217)
* remove import mapping logic in model generation, better handle of file, list * add new files for file, list * fix some tests * update tests, doc * skip file as reserved word in feign client * add new files * remove file from reserved word list in spring generator
This commit is contained in:
parent
3f4e7d8263
commit
33bce99b8e
@ -134,6 +134,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -145,6 +146,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -132,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -143,6 +144,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -142,6 +142,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -155,6 +156,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -138,6 +138,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -149,6 +150,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -139,6 +139,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -150,6 +151,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -142,6 +142,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -153,6 +154,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -132,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -143,6 +144,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -132,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -143,6 +144,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -135,6 +135,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -146,6 +147,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -154,6 +154,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -165,6 +166,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -145,6 +145,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -156,6 +157,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -136,6 +136,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -147,6 +148,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -159,6 +159,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -170,6 +171,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -154,6 +154,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -165,6 +166,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -139,6 +139,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -150,6 +151,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -139,6 +139,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -150,6 +151,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -138,6 +138,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -149,6 +150,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -145,6 +145,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -156,6 +157,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -156,6 +156,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>else</li>
|
||||
<li>enum</li>
|
||||
<li>extends</li>
|
||||
<li>file</li>
|
||||
<li>final</li>
|
||||
<li>finally</li>
|
||||
<li>float</li>
|
||||
@ -167,6 +168,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>instanceof</li>
|
||||
<li>int</li>
|
||||
<li>interface</li>
|
||||
<li>list</li>
|
||||
<li>localreturntype</li>
|
||||
<li>localvaraccept</li>
|
||||
<li>localvaraccepts</li>
|
||||
|
@ -437,19 +437,6 @@ public class DefaultGenerator implements Generator {
|
||||
// process models only
|
||||
for (String name : modelKeys) {
|
||||
try {
|
||||
//don't generate models that have an import mapping
|
||||
if (config.importMapping().containsKey(name)) {
|
||||
LOGGER.debug("Model {} not imported due to import mapping", name);
|
||||
|
||||
for (String templateName : config.modelTemplateFiles().keySet()) {
|
||||
// HACK: Because this returns early, could lead to some invalid model reporting.
|
||||
String filename = config.modelFilename(templateName, name);
|
||||
Path path = java.nio.file.Paths.get(filename);
|
||||
this.templateProcessor.skip(path,"Skipped prior to model processing due to import mapping conflict (either by user or by generator)." );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// don't generate models that are not used as object (e.g. form parameters)
|
||||
if (unusedModels.contains(name)) {
|
||||
if (Boolean.FALSE.equals(skipFormModel)) {
|
||||
@ -517,11 +504,6 @@ public class DefaultGenerator implements Generator {
|
||||
Map<String, Object> models = (Map<String, Object>) allProcessedModels.get(modelName);
|
||||
models.put("modelPackage", config.modelPackage());
|
||||
try {
|
||||
//don't generate models that have an import mapping
|
||||
if (config.importMapping().containsKey(modelName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO revise below as we've already performed unaliasing so that the isAlias check may be removed
|
||||
List<Object> modelList = (List<Object>) models.get("models");
|
||||
if (modelList != null && !modelList.isEmpty()) {
|
||||
|
@ -147,7 +147,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
setReservedWordsLowerCase(
|
||||
Arrays.asList(
|
||||
// special words
|
||||
"object",
|
||||
"object", "list", "file",
|
||||
// used as internal variables, can collide with parameter names
|
||||
"localVarPath", "localVarQueryParams", "localVarCollectionQueryParams",
|
||||
"localVarHeaderParams", "localVarCookieParams", "localVarFormParams", "localVarPostBody",
|
||||
@ -753,12 +753,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
@Override
|
||||
public String toModelName(final String name) {
|
||||
// We need to check if import-mapping has a different model for this class, so we use it
|
||||
// instead of the auto-generated one.
|
||||
if (importMapping.containsKey(name)) {
|
||||
return importMapping.get(name);
|
||||
}
|
||||
|
||||
final String sanitizedName = sanitizeName(name);
|
||||
|
||||
String nameWithPrefixSuffix = sanitizedName;
|
||||
|
@ -423,6 +423,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
//Templates to decode response headers
|
||||
supportingFiles.add(new SupportingFile("model/ApiResponse.mustache", modelsFolder, "ApiResponse.java"));
|
||||
supportingFiles.add(new SupportingFile("ApiResponseDecoder.mustache", invokerFolder, "ApiResponseDecoder.java"));
|
||||
|
||||
// TODO remove "file" from reserved word list as feign client doesn't support using `baseName`
|
||||
// as the parameter name yet
|
||||
reservedWords.remove("file");
|
||||
}
|
||||
|
||||
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || RETROFIT_2.equals(getLibrary()) || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || WEBCLIENT.equals(getLibrary()) || MICROPROFILE.equals(getLibrary()))) {
|
||||
|
@ -242,13 +242,16 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
|
||||
final List<Pair<String, String>> configOptions = additionalProperties.entrySet().stream()
|
||||
.filter(e -> !Arrays.asList(API_FIRST, "hideGenerationTimestamp").contains(e.getKey()))
|
||||
.filter(e -> cliOptions.stream().map(CliOption::getOpt).anyMatch(opt -> opt.equals(e.getKey())))
|
||||
.map(e -> Pair.of(e.getKey(), e.getValue().toString())).collect(Collectors.toList());
|
||||
additionalProperties.put("configOptions", configOptions);
|
||||
|
||||
// TODO remove "file" from reserved word list as feign client doesn't support using `baseName`
|
||||
// as the parameter name yet
|
||||
reservedWords.remove("file");
|
||||
|
||||
// Process java8 option before common java ones to change the default
|
||||
// dateLibrary to java8.
|
||||
LOGGER.info("----------------------------------");
|
||||
|
@ -56,9 +56,9 @@ public class AbstractJavaCodegenTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toModelNameShouldUseProvidedMapping() throws Exception {
|
||||
public void toModelNameShouldNotUseProvidedMapping() throws Exception {
|
||||
fakeJavaCodegen.importMapping().put("json_myclass", "com.test.MyClass");
|
||||
Assert.assertEquals(fakeJavaCodegen.toModelName("json_myclass"), "com.test.MyClass");
|
||||
Assert.assertEquals(fakeJavaCodegen.toModelName("json_myclass"), "JsonMyclass");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -583,7 +583,7 @@ public class AbstractJavaCodegenTest {
|
||||
codegen.setOpenAPI(new OpenAPI().components(new Components().addSchemas("MyStringType", new StringSchema())));
|
||||
Schema<?> schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/MyStringType"));
|
||||
String defaultValue = codegen.getTypeDeclaration(schema);
|
||||
Assert.assertEquals(defaultValue, "List<com.example.foo>");
|
||||
Assert.assertEquals(defaultValue, "List<MyStringType>");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -56,6 +56,7 @@ import org.openapitools.codegen.config.CodegenConfigurator;
|
||||
import org.openapitools.codegen.languages.AbstractJavaCodegen;
|
||||
import org.openapitools.codegen.languages.JavaClientCodegen;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Ignore;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@ -469,7 +470,7 @@ public class JavaClientCodegenTest {
|
||||
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true");
|
||||
List<File> files = generator.opts(clientOptInput).generate();
|
||||
|
||||
Assert.assertEquals(files.size(), 156);
|
||||
Assert.assertEquals(files.size(), 162);
|
||||
validateJavaSourceFiles(files);
|
||||
|
||||
TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/model/Dog.java"),
|
||||
@ -694,7 +695,7 @@ public class JavaClientCodegenTest {
|
||||
|
||||
// this is the type of the field 'typeAlias'. With a working importMapping it should
|
||||
// be 'foo.bar.TypeAlias' or just 'TypeAlias'
|
||||
Assert.assertEquals(fieldMatcher.group(1), "foo.bar.TypeAlias");
|
||||
Assert.assertEquals(fieldMatcher.group(1), "TypeAlias");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -890,8 +891,13 @@ public class JavaClientCodegenTest {
|
||||
|
||||
/**
|
||||
* See https://github.com/OpenAPITools/openapi-generator/issues/4803
|
||||
*
|
||||
* UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
|
||||
* We will contact the contributor of the following test to see if the fix will break their use cases and
|
||||
* how we can fix it accordingly.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testRestTemplateFormMultipart() throws IOException {
|
||||
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
@ -933,8 +939,13 @@ public class JavaClientCodegenTest {
|
||||
|
||||
/**
|
||||
* See https://github.com/OpenAPITools/openapi-generator/issues/4803
|
||||
*
|
||||
* UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
|
||||
* We will contact the contributor of the following test to see if the fix will break their use cases and
|
||||
* how we can fix it accordingly.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testWebClientFormMultipart() throws IOException {
|
||||
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
@ -1005,8 +1016,13 @@ public class JavaClientCodegenTest {
|
||||
|
||||
/**
|
||||
* See https://github.com/OpenAPITools/openapi-generator/issues/6715
|
||||
*
|
||||
* UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
|
||||
* We will contact the contributor of the following test to see if the fix will break their use cases and
|
||||
* how we can fix it accordingly.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testRestTemplateWithUseAbstractionForFiles() throws IOException {
|
||||
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
@ -1129,8 +1145,13 @@ public class JavaClientCodegenTest {
|
||||
|
||||
/**
|
||||
* See https://github.com/OpenAPITools/openapi-generator/issues/6715
|
||||
*
|
||||
* UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
|
||||
* We will contact the contributor of the following test to see if the fix will break their use cases and
|
||||
* how we can fix it accordingly.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testWebClientWithUseAbstractionForFiles() throws IOException {
|
||||
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
@ -1138,7 +1159,6 @@ public class JavaClientCodegenTest {
|
||||
properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api");
|
||||
properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true);
|
||||
|
||||
|
||||
File output = Files.createTempDirectory("test").toFile();
|
||||
output.deleteOnExit();
|
||||
|
||||
|
@ -115,23 +115,25 @@ public class JavaJerseyServerCodegenTest extends JavaJaxrsBaseTest {
|
||||
// almost same test as issue #3139 on Spring
|
||||
@Test
|
||||
public void testMultipartJerseyServer() throws Exception {
|
||||
|
||||
final Map<String, File> files = generateFiles(codegen, "src/test/resources/3_0/form-multipart-binary-array.yaml");
|
||||
|
||||
// Check files for Single, Mixed
|
||||
String[] fileS = {
|
||||
"MultipartSingleApi.java", "MultipartSingleApiService.java", "MultipartSingleApiServiceImpl.java",
|
||||
"MultipartMixedApi.java", "MultipartMixedApiService.java", "MultipartMixedApiServiceImpl.java" };
|
||||
for (String f : fileS){
|
||||
assertFileContains( files.get(f).toPath(), "FormDataBodyPart file" );
|
||||
}
|
||||
|
||||
// UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
|
||||
// We will contact the contributor of the following test to see if the fix will break their use cases and
|
||||
// how we can fix it accordingly.
|
||||
//for (String f : fileS){
|
||||
// assertFileContains( files.get(f).toPath(), "FormDataBodyPart file" );
|
||||
//}
|
||||
|
||||
// Check files for Array
|
||||
final String[] fileA = { "MultipartArrayApiService.java", "MultipartArrayApi.java", "MultipartArrayApiServiceImpl.java"};
|
||||
for (String f : fileA) {
|
||||
assertFileContains( files.get(f).toPath(), "List<FormDataBodyPart> files");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.languages.SpringCodegen;
|
||||
import org.openapitools.codegen.languages.features.CXFServerFeatures;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Ignore;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.io.File;
|
||||
@ -488,9 +489,12 @@ public class SpringCodegenTest {
|
||||
"@ApiParam(value = \"Many files\")",
|
||||
"@RequestPart(value = \"files\", required = false)");
|
||||
|
||||
// Check that the delegate handles the single file
|
||||
final File multipartSingleApiDelegate = files.get("MultipartSingleApiDelegate.java");
|
||||
assertFileContains(multipartSingleApiDelegate.toPath(), "MultipartFile file");
|
||||
// UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
|
||||
// We will contact the contributor of the following test to see if the fix will break their use cases and
|
||||
// how we can fix it accordingly.
|
||||
//// Check that the delegate handles the single file
|
||||
// final File multipartSingleApiDelegate = files.get("MultipartSingleApiDelegate.java");
|
||||
// assertFileContains(multipartSingleApiDelegate.toPath(), "MultipartFile file");
|
||||
|
||||
// Check that the api handles the single file
|
||||
final File multipartSingleApi = files.get("MultipartSingleApi.java");
|
||||
@ -525,7 +529,13 @@ public class SpringCodegenTest {
|
||||
return files.stream().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i));
|
||||
}
|
||||
|
||||
/*
|
||||
* UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
|
||||
* We will contact the contributor of the following test to see if the fix will break their use cases and
|
||||
* how we can fix it accordingly.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testMultipartCloud() throws IOException {
|
||||
final SpringCodegen codegen = new SpringCodegen();
|
||||
codegen.setLibrary("spring-cloud");
|
||||
|
@ -194,7 +194,7 @@ class PetApi {
|
||||
|
||||
}
|
||||
|
||||
def uploadFile ( Long petId, String additionalMetadata, File file, Closure onSuccess, Closure onFailure) {
|
||||
def uploadFile ( Long petId, String additionalMetadata, File _file, Closure onSuccess, Closure onFailure) {
|
||||
String resourcePath = "/pet/${petId}/uploadImage"
|
||||
|
||||
// params
|
||||
@ -214,7 +214,7 @@ class PetApi {
|
||||
contentType = 'multipart/form-data';
|
||||
bodyParams = [:]
|
||||
bodyParams.put("additionalMetadata", additionalMetadata)
|
||||
bodyParams.put("file", file)
|
||||
bodyParams.put("file", _file)
|
||||
|
||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||
"POST", "",
|
||||
|
@ -39,6 +39,8 @@ docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelClient.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -104,6 +106,8 @@ src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass
|
||||
src/main/java/org/openapitools/model/Model200Response.java
|
||||
src/main/java/org/openapitools/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/model/ModelClient.java
|
||||
src/main/java/org/openapitools/model/ModelFile.java
|
||||
src/main/java/org/openapitools/model/ModelList.java
|
||||
src/main/java/org/openapitools/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/model/Name.java
|
||||
src/main/java/org/openapitools/model/NumberOnly.java
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [`java.io.File`](java.io.File.md) | | [optional property]
|
||||
**files** | [`List<java.io.File>`](java.io.File.md) | | [optional property]
|
||||
**_file** | [`ModelFile`](ModelFile.md) | | [optional property]
|
||||
**files** | [`List<ModelFile>`](ModelFile.md) | | [optional property]
|
||||
|
||||
|
||||
|
||||
|
@ -219,7 +219,7 @@ Name | Type | Description | Notes
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
```java
|
||||
Mono<ModelApiResponse> PetApi.uploadFile(petIdadditionalMetadatafile)
|
||||
Mono<ModelApiResponse> PetApi.uploadFile(petIdadditionalMetadata_file)
|
||||
```
|
||||
|
||||
uploads an image
|
||||
@ -229,7 +229,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | `Long`| ID of pet to update |
|
||||
**additionalMetadata** | `String`| Additional data to pass to server | [optional parameter]
|
||||
**file** | `File`| file to upload | [optional parameter]
|
||||
**_file** | `File`| file to upload | [optional parameter]
|
||||
|
||||
|
||||
### Return type
|
||||
|
@ -132,7 +132,7 @@ public interface PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
*/
|
||||
@Post(uri="/pet/{petId}/uploadImage")
|
||||
@ -141,7 +141,7 @@ public interface PetApi {
|
||||
Mono<ModelApiResponse> uploadFile(
|
||||
@PathVariable(name="petId") @NotNull Long petId,
|
||||
String additionalMetadata,
|
||||
File file
|
||||
File _file
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -18,6 +18,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
@ -37,43 +38,43 @@ import javax.annotation.Generated;
|
||||
@Introspected
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@Valid
|
||||
@Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
this.files = new ArrayList<ModelFile>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
@ -87,13 +88,13 @@ public class FileSchemaTestClass {
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -106,20 +107,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -119,6 +121,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -179,6 +179,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -520,7 +520,7 @@ null (empty response body)
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -547,9 +547,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -569,7 +569,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -463,11 +463,11 @@ if (status != null)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
@ -491,8 +491,8 @@ if (status != null)
|
||||
|
||||
if (additionalMetadata != null)
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
localVarFormParams.put("file", file);
|
||||
if (_file != null)
|
||||
localVarFormParams.put("file", _file);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
|
@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
@ -38,48 +39,48 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
|
||||
this.file = file;
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
@ -96,14 +97,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -117,20 +118,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -63,6 +63,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
|
||||
src/main/java/org/openapitools/client/model/EnumArrays.java
|
||||
src/main/java/org/openapitools/client/model/EnumClass.java
|
||||
src/main/java/org/openapitools/client/model/EnumTest.java
|
||||
src/main/java/org/openapitools/client/model/File.java
|
||||
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
|
||||
src/main/java/org/openapitools/client/model/FormatTest.java
|
||||
src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
|
||||
@ -70,6 +71,7 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
File.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@javax.annotation.concurrent.Immutable
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class File {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public File() {
|
||||
}
|
||||
|
||||
public File sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
File file = (File) o;
|
||||
return Objects.equals(this.sourceURI, file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class File {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@ -39,15 +40,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private File file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<File> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
public FileSchemaTestClass file(File file) {
|
||||
|
||||
this.file = file;
|
||||
return this;
|
||||
@ -62,27 +63,27 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
public void setFile(File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<File> files) {
|
||||
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
this.files = new ArrayList<File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
@ -97,14 +98,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for File
|
||||
*/
|
||||
class FileTest {
|
||||
private final File model = new File();
|
||||
|
||||
/**
|
||||
* Model tests for File
|
||||
*/
|
||||
@Test
|
||||
void testFile() {
|
||||
// TODO: test File
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
@ -56,6 +56,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
|
||||
src/main/java/org/openapitools/client/model/EnumArrays.java
|
||||
src/main/java/org/openapitools/client/model/EnumClass.java
|
||||
src/main/java/org/openapitools/client/model/EnumTest.java
|
||||
src/main/java/org/openapitools/client/model/File.java
|
||||
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
|
||||
src/main/java/org/openapitools/client/model/Foo.java
|
||||
src/main/java/org/openapitools/client/model/FormatTest.java
|
||||
@ -66,6 +67,7 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NullableClass.java
|
||||
|
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
File.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class File {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public File() {
|
||||
}
|
||||
|
||||
public File sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
File file = (File) o;
|
||||
return Objects.equals(this.sourceURI, file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class File {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@ -38,15 +39,15 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private File file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<File> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
public FileSchemaTestClass file(File file) {
|
||||
|
||||
this.file = file;
|
||||
return this;
|
||||
@ -61,27 +62,27 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
public void setFile(File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<File> files) {
|
||||
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
this.files = new ArrayList<File>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
@ -96,14 +97,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for File
|
||||
*/
|
||||
class FileTest {
|
||||
private final File model = new File();
|
||||
|
||||
/**
|
||||
* Model tests for File
|
||||
*/
|
||||
@Test
|
||||
void testFile() {
|
||||
// TODO: test File
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -109,6 +111,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -186,6 +186,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -520,7 +520,7 @@ null (empty response body)
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -547,9 +547,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -569,7 +569,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -654,12 +654,12 @@ public class PetApi {
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
* @param _file file to upload
|
||||
* @return ModelApiResponse
|
||||
* @throws IOException if an error occurs while attempting to invoke the API
|
||||
**/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws IOException {
|
||||
HttpResponse response = uploadFileForHttpResponse(petId, additionalMetadata, file);
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws IOException {
|
||||
HttpResponse response = uploadFileForHttpResponse(petId, additionalMetadata, _file);
|
||||
TypeReference<ModelApiResponse> typeRef = new TypeReference<ModelApiResponse>() {};
|
||||
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
|
||||
}
|
||||
@ -678,7 +678,7 @@ public class PetApi {
|
||||
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
|
||||
}
|
||||
|
||||
public HttpResponse uploadFileForHttpResponse(Long petId, String additionalMetadata, File file) throws IOException {
|
||||
public HttpResponse uploadFileForHttpResponse(Long petId, String additionalMetadata, File _file) throws IOException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling uploadFile");
|
||||
|
@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
@ -38,50 +39,50 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
|
||||
this.file = file;
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
this.files = new ArrayList<ModelFile>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
@ -96,14 +97,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -117,20 +118,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -119,6 +121,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -186,6 +186,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -520,7 +520,7 @@ null (empty response body)
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -547,9 +547,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -569,7 +569,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -376,11 +376,11 @@ if (status != null)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
@ -404,8 +404,8 @@ if (status != null)
|
||||
|
||||
if (additionalMetadata != null)
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
localVarFormParams.put("file", file);
|
||||
if (_file != null)
|
||||
localVarFormParams.put("file", _file);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
|
@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
@ -38,50 +39,50 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
|
||||
this.file = file;
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
this.files = new ArrayList<ModelFile>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
@ -96,14 +97,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -117,20 +118,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -121,6 +123,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -211,6 +211,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -513,7 +513,7 @@ null (empty response body)
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -541,9 +541,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -563,7 +563,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -549,7 +549,7 @@ if (status != null)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
* @http.response.details
|
||||
@ -558,8 +558,8 @@ if (status != null)
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
return uploadFileWithHttpInfo(petId, additionalMetadata, file).getData();
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
return uploadFileWithHttpInfo(petId, additionalMetadata, _file).getData();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -567,7 +567,7 @@ if (status != null)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
* @http.response.details
|
||||
@ -576,7 +576,7 @@ if (status != null)
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
@ -599,8 +599,8 @@ if (status != null)
|
||||
|
||||
if (additionalMetadata != null)
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
localVarFormParams.put("file", file);
|
||||
if (_file != null)
|
||||
localVarFormParams.put("file", _file);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
|
@ -26,6 +26,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@ -40,46 +41,46 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
@ -96,14 +97,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -120,20 +121,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -121,6 +123,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -211,6 +211,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -513,7 +513,7 @@ null (empty response body)
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -541,9 +541,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -563,7 +563,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -549,7 +549,7 @@ if (status != null)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
* @http.response.details
|
||||
@ -558,8 +558,8 @@ if (status != null)
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
return uploadFileWithHttpInfo(petId, additionalMetadata, file).getData();
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
return uploadFileWithHttpInfo(petId, additionalMetadata, _file).getData();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -567,7 +567,7 @@ if (status != null)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
* @http.response.details
|
||||
@ -576,7 +576,7 @@ if (status != null)
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
@ -599,8 +599,8 @@ if (status != null)
|
||||
|
||||
if (additionalMetadata != null)
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
if (file != null)
|
||||
localVarFormParams.put("file", file);
|
||||
if (_file != null)
|
||||
localVarFormParams.put("file", _file);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
|
@ -26,6 +26,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@ -40,46 +41,46 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
@ -96,14 +97,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -120,20 +121,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -520,7 +520,7 @@ Name | Type | Description | Notes
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -547,9 +547,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -569,7 +569,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -119,5 +119,5 @@ public interface PetApi {
|
||||
@Path("/{petId}/uploadImage")
|
||||
@Consumes({ "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail) throws ApiException, ProcessingException;
|
||||
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail) throws ApiException, ProcessingException;
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -113,6 +115,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -216,6 +216,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ CompletableFuture<ApiResponse<Void>>
|
||||
|
||||
## uploadFile
|
||||
|
||||
> CompletableFuture<ModelApiResponse> uploadFile(petId, additionalMetadata, file)
|
||||
> CompletableFuture<ModelApiResponse> uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -1136,9 +1136,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
CompletableFuture<ModelApiResponse> result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
CompletableFuture<ModelApiResponse> result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result.get());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -1158,7 +1158,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -1181,7 +1181,7 @@ CompletableFuture<[**ModelApiResponse**](ModelApiResponse.md)>
|
||||
|
||||
## uploadFileWithHttpInfo
|
||||
|
||||
> CompletableFuture<ApiResponse<ModelApiResponse>> uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, file)
|
||||
> CompletableFuture<ApiResponse<ModelApiResponse>> uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -1210,9 +1210,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
CompletableFuture<ApiResponse<ModelApiResponse>> response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
CompletableFuture<ApiResponse<ModelApiResponse>> response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, _file);
|
||||
System.out.println("Status code: " + response.get().getStatusCode());
|
||||
System.out.println("Response headers: " + response.get().getHeaders());
|
||||
System.out.println("Response body: " + response.get().getData());
|
||||
@ -1241,7 +1241,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -703,13 +703,13 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return CompletableFuture<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
public CompletableFuture<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file);
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, _file);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@ -735,13 +735,13 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return CompletableFuture<ApiResponse<ModelApiResponse>>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<ApiResponse<ModelApiResponse>> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
public CompletableFuture<ApiResponse<ModelApiResponse>> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file);
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, _file);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@ -769,7 +769,7 @@ public class PetApi {
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
|
||||
|
@ -26,6 +26,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
@ -39,46 +40,46 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
@ -95,14 +96,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -119,20 +120,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -113,6 +115,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -215,6 +215,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -1045,7 +1045,7 @@ ApiResponse<Void>
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -1072,9 +1072,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -1094,7 +1094,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -1117,7 +1117,7 @@ Name | Type | Description | Notes
|
||||
|
||||
## uploadFileWithHttpInfo
|
||||
|
||||
> ApiResponse<ModelApiResponse> uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, file)
|
||||
> ApiResponse<ModelApiResponse> uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -1145,9 +1145,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ApiResponse<ModelApiResponse> response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
ApiResponse<ModelApiResponse> response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, _file);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders());
|
||||
System.out.println("Response body: " + response.getData());
|
||||
@ -1169,7 +1169,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -644,12 +644,12 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResponse = uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResponse = uploadFileWithHttpInfo(petId, additionalMetadata, _file);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
@ -658,12 +658,12 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file);
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, _file);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
@ -692,7 +692,7 @@ public class PetApi {
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
|
||||
|
@ -26,6 +26,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
@ -39,46 +40,46 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
@ -95,14 +96,14 @@ public class FileSchemaTestClass {
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -119,20 +120,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -38,6 +38,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -124,6 +126,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -186,6 +186,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
|
@ -491,7 +491,7 @@ null (empty response body)
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -517,9 +517,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -538,7 +538,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -1082,7 +1082,7 @@ public class PetApi {
|
||||
* Build call for uploadFile
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
@ -1092,7 +1092,7 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException {
|
||||
public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException {
|
||||
String basePath = null;
|
||||
|
||||
// Operation Servers
|
||||
@ -1129,8 +1129,8 @@ public class PetApi {
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
}
|
||||
|
||||
if (file != null) {
|
||||
localVarFormParams.put("file", file);
|
||||
if (_file != null) {
|
||||
localVarFormParams.put("file", _file);
|
||||
}
|
||||
|
||||
localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams);
|
||||
@ -1156,7 +1156,7 @@ public class PetApi {
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException {
|
||||
private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException {
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -1164,7 +1164,7 @@ public class PetApi {
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, file, _callback);
|
||||
okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
@ -1174,7 +1174,7 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
@ -1183,8 +1183,8 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResp = uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResp = uploadFileWithHttpInfo(petId, additionalMetadata, _file);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
@ -1193,7 +1193,7 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
@ -1202,8 +1202,8 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null);
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, null);
|
||||
Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
}
|
||||
@ -1213,7 +1213,7 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
@ -1223,9 +1223,9 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback<ModelApiResponse> _callback) throws ApiException {
|
||||
public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File _file, final ApiCallback<ModelApiResponse> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, _callback);
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, _callback);
|
||||
Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
|
@ -25,6 +25,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ModelFile;
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
@ -33,47 +34,47 @@ import java.util.List;
|
||||
public class FileSchemaTestClass {
|
||||
public static final String SERIALIZED_NAME_FILE = "file";
|
||||
@SerializedName(SERIALIZED_NAME_FILE)
|
||||
private java.io.File file;
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<java.io.File> files = null;
|
||||
private List<ModelFile> files = null;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
public FileSchemaTestClass _file(ModelFile _file) {
|
||||
|
||||
this.file = file;
|
||||
this._file = _file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
* Get _file
|
||||
* @return _file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
public FileSchemaTestClass files(List<ModelFile> files) {
|
||||
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<java.io.File>();
|
||||
this.files = new ArrayList<ModelFile>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
@ -86,12 +87,12 @@ public class FileSchemaTestClass {
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
@ -105,20 +106,20 @@ public class FileSchemaTestClass {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
return Objects.equals(this._file, fileSchemaTestClass._file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
return Objects.hash(_file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -49,6 +49,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NullableClass.md
|
||||
@ -162,6 +164,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NullableClass.java
|
||||
|
@ -196,6 +196,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NullableClass](docs/NullableClass.md)
|
||||
|
@ -464,7 +464,7 @@ null (empty response body)
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -490,9 +490,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
|
||||
@ -507,7 +507,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -258,6 +258,8 @@ public class JSON {
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.ModelApiResponse.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.ModelFile.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.ModelList.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.ModelReturn.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.Name.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.NullableClass.CustomTypeAdapterFactory())
|
||||
|
@ -922,7 +922,7 @@ public class PetApi {
|
||||
* Build call for uploadFile
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
@ -932,7 +932,7 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException {
|
||||
public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// create path and map variables
|
||||
@ -949,8 +949,8 @@ public class PetApi {
|
||||
localVarFormParams.put("additionalMetadata", additionalMetadata);
|
||||
}
|
||||
|
||||
if (file != null) {
|
||||
localVarFormParams.put("file", file);
|
||||
if (_file != null) {
|
||||
localVarFormParams.put("file", _file);
|
||||
}
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
@ -974,7 +974,7 @@ public class PetApi {
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException {
|
||||
private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException {
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
@ -982,7 +982,7 @@ public class PetApi {
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, file, _callback);
|
||||
okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
@ -992,7 +992,7 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
@ -1001,8 +1001,8 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResp = uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResp = uploadFileWithHttpInfo(petId, additionalMetadata, _file);
|
||||
return localVarResp.getData();
|
||||
}
|
||||
|
||||
@ -1011,7 +1011,7 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
@ -1020,8 +1020,8 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null);
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException {
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, null);
|
||||
try {
|
||||
Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);
|
||||
@ -1037,7 +1037,7 @@ public class PetApi {
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @param _file file to upload (optional)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
@ -1047,9 +1047,9 @@ public class PetApi {
|
||||
<tr><td> 200 </td><td> successful operation </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback<ModelApiResponse> _callback) throws ApiException {
|
||||
public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File _file, final ApiCallback<ModelApiResponse> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, _callback);
|
||||
okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, _callback);
|
||||
Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
|
@ -39,6 +39,8 @@ docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NumberOnly.md
|
||||
@ -124,6 +126,8 @@ src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
|
@ -186,6 +186,8 @@ Class | Method | HTTP request | Description
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
**_file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**List<ModelFile>**](ModelFile.md) | | [optional]
|
||||
|
||||
|
||||
## Implemented Interfaces
|
||||
|
@ -491,7 +491,7 @@ null (empty response body)
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
@ -517,9 +517,9 @@ public class Example {
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@ -538,7 +538,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
**_file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user