forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.0.x-sync-master4
This commit is contained in:
commit
47a9294a99
@ -567,6 +567,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
|
||||
- [Adaptant Solutions AG](https://www.adaptant.io/)
|
||||
- [Agoda](https://www.agoda.com/)
|
||||
- [Allianz](https://www.allianz.com)
|
||||
- [Angular.Schule](https://angular.schule/)
|
||||
- [Australia and New Zealand Banking Group (ANZ)](http://www.anz.com/)
|
||||
- [ASKUL](https://www.askul.co.jp)
|
||||
|
16
bin/ci/java-rest-assured-jackson.json
Normal file
16
bin/ci/java-rest-assured-jackson.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"!include": "bin/java-petstore-rest-assured-jackson.json",
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/rest-assured-jackson",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/rest-assured",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"booleanGetterPrefix": "is",
|
||||
"java8": "true",
|
||||
"dateLibrary": "java8",
|
||||
"serializationLibrary": "jackson",
|
||||
"useBeanValidation": "true",
|
||||
"performBeanValidation": "true"
|
||||
}
|
||||
}
|
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-dotnet2 -t modules/openapi-generator/src/main/resources/csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/documentation/html2 --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/documentation/html2 -t modules/openapi-generator/src/main/resources/htmlDocs2/ --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -12,6 +12,7 @@
|
||||
./bin/java-petstore-okhttp-gson-parcelable.sh
|
||||
./bin/java-petstore-okhttp-gson.sh
|
||||
./bin/java-petstore-rest-assured.sh
|
||||
./bin/java-petstore-rest-assured-jackson.sh
|
||||
./bin/java-petstore-resteasy.sh
|
||||
./bin/java-petstore-resttemplate-withxml.sh
|
||||
./bin/java-petstore-resttemplate.sh
|
||||
|
4
bin/java-petstore-rest-assured-jackson.json
Normal file
4
bin/java-petstore-rest-assured-jackson.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"library": "rest-assured",
|
||||
"artifactId": "petstore-rest-assured-jackson"
|
||||
}
|
36
bin/java-petstore-rest-assured-jackson.sh
Executable file
36
bin/java-petstore-rest-assured-jackson.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
target_dir="./samples/client/petstore/java/rest-assured-jackson/"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/Java/libraries/rest-assured -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured-jackson.json -o ${target_dir} --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is --additional-properties java8=true --additional-properties dateLibrary=java8 --additional-properties serializationLibrary=jackson $@"
|
||||
|
||||
echo "Removing ${target_dir}"
|
||||
rm -rf "${target_dir}"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $args
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/OpenApiClientTest/Lib/OpenApiClient --additional-properties hideGenerationTimestamp=true
|
||||
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g csharp-dotnet2 -t modules/openapi-generator/src/main/resources/csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/OpenApiClientTest/Lib/OpenApiClient --additional-properties hideGenerationTimestamp=true
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -20,4 +20,5 @@ call .\bin\windows\java-petstore-webclient.bat
|
||||
call .\bin\windows\java-petstore-resteasy.bat
|
||||
call .\bin\windows\java-petstore-google-api-client.bat
|
||||
call .\bin\windows\java-petstore-rest-assured.bat
|
||||
call .\bin\windows\java-petstore-rest-assured-jackson.bat
|
||||
call .\bin\windows\java-petstore-vertx.bat
|
||||
|
10
bin/windows/java-petstore-rest-assured-jackson.bat
Normal file
10
bin/windows/java-petstore-rest-assured-jackson.bat
Normal file
@ -0,0 +1,10 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -t modules\openapi-generator\src\main\resources\Java\libraries\rest-assured -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-rest-assured-jackson.json -o samples\client\petstore\java\rest-assured-jackson --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is,java8=true,dateLibrary=java8,serializationLibrary=jackson,useBeanValidation=true,performBeanValidation=true,
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
@ -640,7 +640,7 @@ open class GenerateTask : DefaultTask() {
|
||||
|
||||
DefaultGenerator().opts(clientOptInput).generate()
|
||||
|
||||
out.println("Successfully generated code to $outputDir")
|
||||
out.println("Successfully generated code to ${outputDir.get()}")
|
||||
} catch (e: RuntimeException) {
|
||||
throw GradleException("Code generation failed.", e)
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ import com.google.common.io.Files;
|
||||
* Goal which generates client/server code from a OpenAPI json/yaml definition.
|
||||
*/
|
||||
@SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"})
|
||||
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
|
||||
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
|
||||
public class CodeGenMojo extends AbstractMojo {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CodeGenMojo.class);
|
||||
|
@ -74,7 +74,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
public Set<String> allMandatory = new TreeSet<String>(); // with parent's required properties
|
||||
|
||||
public Set<String> imports = new TreeSet<String>();
|
||||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArrayModel, hasChildren, isMapModel;
|
||||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArrayModel, hasChildren, isMapModel, isDeprecated;
|
||||
public boolean hasOnlyReadOnly = true; // true if all properties are read-only
|
||||
public ExternalDocumentation externalDocumentation;
|
||||
|
||||
@ -543,6 +543,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
isArrayModel == that.isArrayModel &&
|
||||
hasChildren == that.hasChildren &&
|
||||
isMapModel == that.isMapModel &&
|
||||
isDeprecated == that.isDeprecated &&
|
||||
hasOnlyReadOnly == that.hasOnlyReadOnly &&
|
||||
getUniqueItems() == that.getUniqueItems() &&
|
||||
getExclusiveMinimum() == that.getExclusiveMinimum() &&
|
||||
@ -609,7 +610,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
getVars(), getAllVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(),
|
||||
getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars,
|
||||
isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArrayModel,
|
||||
hasChildren, isMapModel, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(),
|
||||
hasChildren, isMapModel, isDeprecated, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(),
|
||||
getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(),
|
||||
getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(),
|
||||
getMaximum(), getPattern(), getMultipleOf());
|
||||
@ -673,6 +674,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
sb.append(", isArrayModel=").append(isArrayModel);
|
||||
sb.append(", hasChildren=").append(hasChildren);
|
||||
sb.append(", isMapModel=").append(isMapModel);
|
||||
sb.append(", isDeprecated=").append(isDeprecated);
|
||||
sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly);
|
||||
sb.append(", externalDocumentation=").append(externalDocumentation);
|
||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||
|
@ -2134,6 +2134,10 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|| isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types
|
||||
m.discriminator = createDiscriminator(name, schema);
|
||||
|
||||
if (schema.getDeprecated() != null) {
|
||||
m.isDeprecated = schema.getDeprecated();
|
||||
}
|
||||
|
||||
if (schema.getXml() != null) {
|
||||
m.xmlPrefix = schema.getXml().getPrefix();
|
||||
m.xmlNamespace = schema.getXml().getNamespace();
|
||||
@ -5539,6 +5543,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
setParameterNullable(codegenParameter, codegenProperty);
|
||||
}
|
||||
|
||||
addJsonSchemaForBodyRequestInCaseItsNotPresent(codegenParameter, body);
|
||||
|
||||
// set the parameter's example value
|
||||
// should be overridden by lang codegen
|
||||
setParameterExampleValue(codegenParameter, body);
|
||||
@ -5546,6 +5552,11 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
return codegenParameter;
|
||||
}
|
||||
|
||||
private void addJsonSchemaForBodyRequestInCaseItsNotPresent(CodegenParameter codegenParameter, RequestBody body){
|
||||
if(codegenParameter.jsonSchema == null)
|
||||
codegenParameter.jsonSchema = Json.pretty(body);
|
||||
}
|
||||
|
||||
protected void addOption(String key, String description, String defaultValue) {
|
||||
CliOption option = new CliOption(key, description);
|
||||
if (defaultValue != null)
|
||||
|
@ -362,8 +362,10 @@ public class InlineModelResolver {
|
||||
ListIterator<Schema> listIterator = children.listIterator();
|
||||
while (listIterator.hasNext()) {
|
||||
Schema component = listIterator.next();
|
||||
if (component instanceof ObjectSchema) {
|
||||
ObjectSchema op = (ObjectSchema) component;
|
||||
if (component instanceof ObjectSchema || // for inline schema with type:object
|
||||
(component != null && component.getProperties() != null &&
|
||||
!component.getProperties().isEmpty())) { // for inline schema without type:object
|
||||
Schema op = component;
|
||||
if (op.get$ref() == null && op.getProperties() != null && op.getProperties().size() > 0) {
|
||||
// If a `title` attribute is defined in the inline schema, codegen uses it to name the
|
||||
// inline schema. Otherwise, we'll use the default naming such as InlineObject1, etc.
|
||||
@ -390,6 +392,8 @@ public class InlineModelResolver {
|
||||
listIterator.set(schema);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// likely a reference to schema (not inline schema)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -607,7 +611,7 @@ public class InlineModelResolver {
|
||||
}
|
||||
}
|
||||
|
||||
private Schema modelFromProperty(ObjectSchema object, String path) {
|
||||
private Schema modelFromProperty(Schema object, String path) {
|
||||
String description = object.getDescription();
|
||||
String example = null;
|
||||
Object obj = object.getExample();
|
||||
|
@ -79,22 +79,8 @@ public class CodegenConfigurator {
|
||||
public static CodegenConfigurator fromFile(String configFile, Module... modules) {
|
||||
|
||||
if (isNotEmpty(configFile)) {
|
||||
ObjectMapper mapper;
|
||||
DynamicSettings settings = readDynamicSettings(configFile, modules);
|
||||
|
||||
if (FilenameUtils.isExtension(configFile, new String[]{"yml", "yaml"})) {
|
||||
mapper = Yaml.mapper();
|
||||
} else {
|
||||
mapper = Json.mapper();
|
||||
}
|
||||
|
||||
if (modules != null && modules.length > 0) {
|
||||
mapper.registerModules(modules);
|
||||
}
|
||||
|
||||
mapper.registerModule(new GuavaModule());
|
||||
|
||||
try {
|
||||
DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class);
|
||||
CodegenConfigurator configurator = new CodegenConfigurator();
|
||||
|
||||
GeneratorSettings generatorSettings = settings.getGeneratorSettings();
|
||||
@ -134,13 +120,32 @@ public class CodegenConfigurator {
|
||||
configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(workflowSettings);
|
||||
|
||||
return configurator;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static DynamicSettings readDynamicSettings(String configFile, Module... modules) {
|
||||
ObjectMapper mapper;
|
||||
|
||||
if (FilenameUtils.isExtension(configFile.toLowerCase(Locale.ROOT), new String[]{"yml", "yaml"})) {
|
||||
mapper = Yaml.mapper().copy();
|
||||
} else {
|
||||
mapper = Json.mapper().copy();
|
||||
}
|
||||
|
||||
if (modules != null && modules.length > 0) {
|
||||
mapper.registerModules(modules);
|
||||
}
|
||||
|
||||
mapper.registerModule(new GuavaModule());
|
||||
|
||||
try {
|
||||
return mapper.readValue(new File(configFile), DynamicSettings.class);
|
||||
} catch (IOException ex) {
|
||||
LOGGER.error(ex.getMessage());
|
||||
throw new RuntimeException("Unable to deserialize config file: " + configFile);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public CodegenConfigurator addServerVariable(String key, String value) {
|
||||
this.serverVariables.put(key, value);
|
||||
|
@ -19,6 +19,7 @@ package org.openapitools.codegen.languages;
|
||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
@ -622,6 +623,28 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
||||
supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
@Override
|
||||
public String escapeText(String input) {
|
||||
|
||||
if (input == null) {
|
||||
return input;
|
||||
}
|
||||
|
||||
// remove \t, \n, \r
|
||||
// replace \ with \\
|
||||
// replace " with \"
|
||||
// outter unescape to retain the original multi-byte characters
|
||||
// finally escalate characters avoiding code injection
|
||||
return escapeUnsafeCharacters(
|
||||
StringEscapeUtils.unescapeJava(
|
||||
StringEscapeUtils.escapeJava(input)
|
||||
.replace("\\/", "/"))
|
||||
.replaceAll("[\\t\\n\\r]", " ")
|
||||
.replace("\\", "\\\\")
|
||||
.replace("\"", "\"\""));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeUnsafeCharacters(String input) {
|
||||
return input.replace("#>", "#_>").replace("<#", "<_#");
|
||||
|
@ -409,6 +409,7 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements
|
||||
entityMarshallerTypes.add(marshaller);
|
||||
operationSpecificMarshallers.add(marshaller);
|
||||
}
|
||||
response.vendorExtensions.put("x-empty-response", response.baseType == null && response.message == null);
|
||||
response.vendorExtensions.put("x-is-default", response.code.equals("0"));
|
||||
}
|
||||
op.vendorExtensions.put("x-specific-marshallers", operationSpecificMarshallers);
|
||||
|
@ -110,6 +110,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
||||
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
|
||||
supportingFiles.add(new SupportingFile("npmignore", "", ".npmignore"));
|
||||
|
||||
if (additionalProperties.containsKey(SEPARATE_MODELS_AND_API)) {
|
||||
boolean separateModelsAndApi = Boolean.parseBoolean(additionalProperties.get(SEPARATE_MODELS_AND_API).toString());
|
||||
|
@ -1104,9 +1104,9 @@ public class ModelUtils {
|
||||
public static Map<String, List<String>> getChildrenMap(OpenAPI openAPI) {
|
||||
Map<String, Schema> allSchemas = getSchemas(openAPI);
|
||||
|
||||
// FIXME: The collect here will throw NPE if a spec document has only a single oneOf hierarchy.
|
||||
Map<String, List<Entry<String, Schema>>> groupedByParent = allSchemas.entrySet().stream()
|
||||
.filter(entry -> isComposedSchema(entry.getValue()))
|
||||
.filter(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas)!=null)
|
||||
.collect(Collectors.groupingBy(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas)));
|
||||
|
||||
return groupedByParent.entrySet().stream()
|
||||
@ -1165,14 +1165,6 @@ public class ModelUtils {
|
||||
int nullSchemaChildrenCount = 0;
|
||||
boolean hasAmbiguousParents = false;
|
||||
List<String> refedWithoutDiscriminator = new ArrayList<>();
|
||||
String schemaName = "";
|
||||
for (String thisSchemaName : allSchemas.keySet()) {
|
||||
Schema sc = allSchemas.get(thisSchemaName);
|
||||
if (isComposedSchema(sc) && (ComposedSchema) sc == composedSchema) {
|
||||
schemaName = thisSchemaName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (interfaces != null && !interfaces.isEmpty()) {
|
||||
for (Schema schema : interfaces) {
|
||||
@ -1189,11 +1181,8 @@ public class ModelUtils {
|
||||
} else {
|
||||
// not a parent since discriminator.propertyName is not set
|
||||
hasAmbiguousParents = true;
|
||||
boolean isNotExtractedInlineSchema = !parentName.equals(schemaName+"_allOf");
|
||||
if (isNotExtractedInlineSchema) {
|
||||
refedWithoutDiscriminator.add(parentName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// not a ref, doing nothing, except counting the number of times the 'null' type
|
||||
// is listed as composed element.
|
||||
@ -1236,7 +1225,6 @@ public class ModelUtils {
|
||||
public static List<String> getAllParentsName(ComposedSchema composedSchema, Map<String, Schema> allSchemas, boolean includeAncestors) {
|
||||
List<Schema> interfaces = getInterfaces(composedSchema);
|
||||
List<String> names = new ArrayList<String>();
|
||||
List<String> refedWithoutDiscriminator = new ArrayList<>();
|
||||
|
||||
if (interfaces != null && !interfaces.isEmpty()) {
|
||||
for (Schema schema : interfaces) {
|
||||
@ -1255,7 +1243,6 @@ public class ModelUtils {
|
||||
}
|
||||
} else {
|
||||
// not a parent since discriminator.propertyName is not set
|
||||
refedWithoutDiscriminator.add(parentName);
|
||||
}
|
||||
} else {
|
||||
// not a ref, doing nothing
|
||||
@ -1263,10 +1250,11 @@ public class ModelUtils {
|
||||
}
|
||||
}
|
||||
|
||||
if (names.size() == 0 && refedWithoutDiscriminator.size() == 1) {
|
||||
LOGGER.warn("[deprecated] inheritance without use of 'discriminator.propertyName' is deprecated " +
|
||||
"and will be removed in a future release. Generating model for {}. Title: {}", composedSchema.getName(), composedSchema.getTitle());
|
||||
return refedWithoutDiscriminator;
|
||||
// ensure `allParents` always includes `parent`
|
||||
// this is more robust than keeping logic in getParentName() and getAllParentsName() in sync
|
||||
String parentName = getParentName(composedSchema, allSchemas);
|
||||
if (parentName != null && !names.contains(parentName)) {
|
||||
names.add(parentName);
|
||||
}
|
||||
|
||||
return names;
|
||||
|
@ -101,7 +101,10 @@ ext {
|
||||
{{#jackson}}
|
||||
jackson_version = "2.10.3"
|
||||
jackson_databind_version = "2.10.3"
|
||||
jackson_databind_nullable_version = 0.2.1
|
||||
jackson_databind_nullable_version = "0.2.1"
|
||||
{{#threetenbp}}
|
||||
jackson_threetenbp_version = "2.10.0"
|
||||
{{/threetenbp}}
|
||||
{{/jackson}}
|
||||
{{#gson}}
|
||||
gson_version = "2.8.6"
|
||||
@ -119,13 +122,25 @@ ext {
|
||||
dependencies {
|
||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||
compile "com.google.code.findbugs:jsr305:3.0.2"
|
||||
compile "io.rest-assured:scala-support:$rest_assured_version"
|
||||
compile "io.rest-assured:rest-assured:$rest_assured_version"
|
||||
{{#jackson}}
|
||||
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
|
||||
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
|
||||
compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
|
||||
{{#withXml}}
|
||||
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version"
|
||||
{{/withXml}}
|
||||
{{#joda}}
|
||||
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
|
||||
{{/joda}}
|
||||
{{#java8}}
|
||||
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||||
{{/java8}}
|
||||
{{#threetenbp}}
|
||||
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version"
|
||||
{{/threetenbp}}
|
||||
{{/jackson}}
|
||||
{{#gson}}
|
||||
compile "io.gsonfire:gson-fire:$gson_fire_version"
|
||||
|
@ -10,11 +10,26 @@ lazy val root = (project in file(".")).
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
"io.swagger" % "swagger-annotations" % "1.5.21",
|
||||
"io.rest-assured" % "rest-assured" % "4.3.0",
|
||||
"io.rest-assured" % "scala-support" % "4.3.0",
|
||||
"com.google.code.findbugs" % "jsr305" % "3.0.2",
|
||||
{{#jackson}}
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.1",
|
||||
{{#withXml}}
|
||||
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.3",
|
||||
{{/withXml}}
|
||||
{{#joda}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.3",
|
||||
{{/joda}}
|
||||
{{#java8}}
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3",
|
||||
{{/java8}}
|
||||
{{#threetenbp}}
|
||||
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.10.0",
|
||||
{{/threetenbp}}
|
||||
{{/jackson}}
|
||||
{{#gson}}
|
||||
"com.google.code.gson" % "gson" % "2.8.6",
|
||||
@ -31,7 +46,7 @@ lazy val root = (project in file(".")).
|
||||
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
|
||||
{{/useBeanValidation}}
|
||||
{{#performBeanValidation}}
|
||||
"org.hibernate" % "hibernate-validator" "6.0.19.Final" % "compile",
|
||||
"org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
|
||||
{{/performBeanValidation}}
|
||||
"junit" % "junit" % "4.13" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||
|
@ -261,8 +261,25 @@ namespace {{clientPackage}}
|
||||
{
|
||||
{{#authMethods}}
|
||||
case "{{name}}":
|
||||
{{#isApiKey}}{{#isKeyInHeader}}headerParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}}queryParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password);{{/isBasic}}
|
||||
{{#isOAuth}}//TODO support oauth{{/isOAuth}}
|
||||
{{#isApiKey}}
|
||||
{{#isKeyInHeader}}
|
||||
headerParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");
|
||||
{{/isKeyInHeader}}
|
||||
{{#isKeyInQuery}}
|
||||
queryParams["{{keyParamName}}"] = GetApiKeyWithPrefix("{{keyParamName}}");
|
||||
{{/isKeyInQuery}}
|
||||
{{/isApiKey}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password);
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
headerParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isOAuth}}
|
||||
headerParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||
{{/isOAuth}}
|
||||
break;
|
||||
{{/authMethods}}
|
||||
default:
|
||||
|
@ -37,6 +37,12 @@ namespace {{clientPackage}}
|
||||
/// <value>The password.</value>
|
||||
public static String Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the access token (Bearer/OAuth authentication).
|
||||
/// </summary>
|
||||
/// <value>The access token.</value>
|
||||
public static String AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the API key based on the authentication name.
|
||||
/// </summary>
|
||||
|
@ -56,16 +56,31 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
|
||||
{{#hasAuthMethods}}
|
||||
{{#authMethods}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
// Configure HTTP basic authorization: {{{name}}}
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
// Configure Bearer access token for authorization: {{{name}}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isApiKey}}
|
||||
// Configure API key authorization: {{{name}}}
|
||||
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
|
||||
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
{{/hasAuthMethods}}
|
||||
|
||||
var apiInstance = new {{classname}}();
|
||||
@ -123,21 +138,29 @@ No model defined in this package
|
||||
All endpoints do not require authorization.
|
||||
{{/authMethods}}
|
||||
{{#authMethods}}
|
||||
{{#last}}
|
||||
{{#-last}}
|
||||
Authentication schemes defined for the API:
|
||||
{{/last}}
|
||||
{{/-last}}
|
||||
{{/authMethods}}
|
||||
{{#authMethods}}
|
||||
<a name="{{name}}"></a>
|
||||
### {{name}}
|
||||
|
||||
{{#isApiKey}}- **Type**: API key
|
||||
{{#isApiKey}}
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: {{keyParamName}}
|
||||
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
|
||||
{{/isApiKey}}
|
||||
{{#isBasic}}- **Type**: HTTP basic authentication
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
- **Type**: HTTP basic authentication
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
- **Type**: HTTP bearer authentication
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isOAuth}}- **Type**: OAuth
|
||||
{{#isOAuth}}
|
||||
- **Type**: OAuth
|
||||
- **Flow**: {{flow}}
|
||||
- **Authorization URL**: {{authorizationUrl}}
|
||||
- **Scopes**: {{^scopes}}N/A{{/scopes}}
|
||||
|
@ -32,18 +32,32 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}
|
||||
{{#hasAuthMethods}}
|
||||
{{#authMethods}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
// Configure HTTP basic authorization: {{{name}}}
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";{{/isBasic}}{{#isApiKey}}
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
// Configure Bearer access token: {{{name}}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isApiKey}}
|
||||
// Configure API key authorization: {{{name}}}
|
||||
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");{{/isApiKey}}{{#isOAuth}}
|
||||
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}}
|
||||
{{/hasAuthMethods}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
|
||||
{{/hasAuthMethods}}
|
||||
var apiInstance = new {{classname}}();
|
||||
{{#allParams}}
|
||||
{{#isPrimitiveType}}
|
||||
|
@ -169,7 +169,7 @@ namespace {{packageName}}.Client
|
||||
public static String SelectHeaderContentType(String[] contentTypes)
|
||||
{
|
||||
if (contentTypes.Length == 0)
|
||||
return "application/json";
|
||||
return null;
|
||||
|
||||
foreach (var contentType in contentTypes)
|
||||
{
|
||||
|
@ -119,9 +119,15 @@ namespace Example
|
||||
{{#hasAuthMethods}}
|
||||
{{#authMethods}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
// Configure HTTP basic authorization: {{{name}}}
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
// Configure HTTP bearer authorization: {{{name}}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isApiKey}}
|
||||
// Configure API key authorization: {{{name}}}
|
||||
@ -205,8 +211,14 @@ Authentication schemes defined for the API:
|
||||
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
|
||||
{{/isApiKey}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
|
||||
- **Type**: HTTP bearer authentication
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isOAuth}}
|
||||
|
||||
|
@ -278,11 +278,20 @@ namespace {{packageName}}.{{apiPackage}}
|
||||
{{/isKeyInQuery}}
|
||||
{{/isApiKey}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
// http basic authentication required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password);
|
||||
}
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
// http beerer authentication required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken;
|
||||
}
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isOAuth}}
|
||||
// oauth required
|
||||
@ -414,11 +423,20 @@ namespace {{packageName}}.{{apiPackage}}
|
||||
{{/isKeyInQuery}}
|
||||
{{/isApiKey}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
// http basic authentication required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password);
|
||||
}
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
// http bearer authentication required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken;
|
||||
}
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isOAuth}}
|
||||
// oauth required
|
||||
|
@ -39,9 +39,15 @@ namespace Example
|
||||
{{#hasAuthMethods}}
|
||||
{{#authMethods}}
|
||||
{{#isBasic}}
|
||||
{{#isBasicBasic}}
|
||||
// Configure HTTP basic authorization: {{{name}}}
|
||||
Configuration.Default.Username = "YOUR_USERNAME";
|
||||
Configuration.Default.Password = "YOUR_PASSWORD";
|
||||
{{/isBasicBasic}}
|
||||
{{#isBasicBearer}}
|
||||
// Configure HTTP bearer authorization: {{{name}}}
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
{{/isBasicBearer}}
|
||||
{{/isBasic}}
|
||||
{{#isApiKey}}
|
||||
// Configure API key authorization: {{{name}}}
|
||||
|
@ -101,6 +101,31 @@
|
||||
//Convert elements with "marked" class to markdown
|
||||
processMarked();
|
||||
});
|
||||
|
||||
function findNode(id, currentNode) {
|
||||
return (Object.keys(currentNode)[0] === id) ? currentNode : findNodeInChildren(id, currentNode);
|
||||
}
|
||||
|
||||
function findNodeInChildren(id, currentNode) {
|
||||
for (let prop in currentNode) {
|
||||
if (currentNode.hasOwnProperty(prop)) {
|
||||
let currentChild = currentNode[prop];
|
||||
if (id === prop) {
|
||||
return currentChild;
|
||||
} else {
|
||||
// Search in the current child
|
||||
if (typeof (currentChild) === 'object') {
|
||||
let result = findNode(id, currentChild);
|
||||
if (result !== false) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
{{>fonts}}
|
||||
@ -416,9 +441,14 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {{{jsonSchema}}};
|
||||
var schema = schemaWrapper.schema;
|
||||
var schema = findNode('schema',schemaWrapper).schema;
|
||||
if (!schema) {
|
||||
schema = schemaWrapper.schema;
|
||||
}
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else if (schema.items != null && schema.items.$ref != null) {
|
||||
schema.items = defsParser.$refs.get(schema.items.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
@ -505,8 +535,7 @@
|
||||
{{>js_json_stringify_safe}}
|
||||
{{>js_webfontloader}}
|
||||
<script>
|
||||
var schemaWrapper = {};
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
var schemaWrapper = { "components": { "schemas" : defs}};
|
||||
defsParser = new $RefParser();
|
||||
defsParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
|
@ -4,7 +4,10 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {{{jsonSchema}}};
|
||||
var schema = schemaWrapper.schema;
|
||||
var schema = findNode('schema', schemaWrapper).schema;
|
||||
if (!schema) {
|
||||
schema = schemaWrapper.schema;
|
||||
}
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
|
@ -43,3 +43,112 @@ CREATE TABLE IF NOT EXISTS {{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{
|
||||
{{/vendorExtensions}}
|
||||
|
||||
{{/isArrayModel}}{{/hasVars}}{{/model}}{{/models}}
|
||||
{{#hasOAuthMethods}}
|
||||
--
|
||||
-- OAuth2 framework tables
|
||||
-- Thanks to https://github.com/dsquier/oauth2-server-php-mysql repo
|
||||
--
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_clients`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_clients` (
|
||||
`client_id` VARCHAR(80) NOT NULL,
|
||||
`client_secret` VARCHAR(80) DEFAULT NULL,
|
||||
`redirect_uri` VARCHAR(2000) DEFAULT NULL,
|
||||
`grant_types` VARCHAR(80) DEFAULT NULL,
|
||||
`scope` VARCHAR(4000) DEFAULT NULL,
|
||||
`user_id` VARCHAR(80) DEFAULT NULL,
|
||||
PRIMARY KEY (`client_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_access_tokens`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_access_tokens` (
|
||||
`access_token` VARCHAR(40) NOT NULL,
|
||||
`client_id` VARCHAR(80) DEFAULT NULL,
|
||||
`user_id` VARCHAR(80) DEFAULT NULL,
|
||||
`expires` TIMESTAMP NOT NULL,
|
||||
`scope` VARCHAR(4000) DEFAULT NULL,
|
||||
PRIMARY KEY (`access_token`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_authorization_codes`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_authorization_codes` (
|
||||
`authorization_code` VARCHAR(40) NOT NULL,
|
||||
`client_id` VARCHAR(80) DEFAULT NULL,
|
||||
`user_id` VARCHAR(80) DEFAULT NULL,
|
||||
`redirect_uri` VARCHAR(2000) NOT NULL,
|
||||
`expires` TIMESTAMP NOT NULL,
|
||||
`scope` VARCHAR(4000) DEFAULT NULL,
|
||||
`id_token` VARCHAR(1000) DEFAULT NULL,
|
||||
PRIMARY KEY (`authorization_code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_refresh_tokens`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_refresh_tokens` (
|
||||
`refresh_token` VARCHAR(40) NOT NULL,
|
||||
`client_id` VARCHAR(80) DEFAULT NULL,
|
||||
`user_id` VARCHAR(80) DEFAULT NULL,
|
||||
`expires` TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`scope` VARCHAR(4000) DEFAULT NULL,
|
||||
PRIMARY KEY (`refresh_token`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_users`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_users` (
|
||||
`username` VARCHAR(80) DEFAULT NULL,
|
||||
`password` VARCHAR(255) DEFAULT NULL,
|
||||
`first_name` VARCHAR(80) DEFAULT NULL,
|
||||
`last_name` VARCHAR(80) DEFAULT NULL,
|
||||
`email` VARCHAR(2000) DEFAULT NULL,
|
||||
`email_verified` TINYINT(1) DEFAULT NULL,
|
||||
`scope` VARCHAR(4000) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_scopes`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_scopes` (
|
||||
`scope` VARCHAR(80) NOT NULL,
|
||||
`is_default` TINYINT(1) DEFAULT NULL,
|
||||
PRIMARY KEY (`scope`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_jwt`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_jwt` (
|
||||
`client_id` VARCHAR(80) NOT NULL,
|
||||
`subject` VARCHAR(80) DEFAULT NULL,
|
||||
`public_key` VARCHAR(2000) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_jti`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_jti` (
|
||||
`issuer` VARCHAR(80) NOT NULL,
|
||||
`subject` VARCHAR(80) DEFAULT NULL,
|
||||
`audiance` VARCHAR(80) DEFAULT NULL,
|
||||
`expires` TIMESTAMP NOT NULL,
|
||||
`jti` VARCHAR(2000) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
--
|
||||
-- Table structure for table `oauth_public_keys`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `oauth_public_keys` (
|
||||
`client_id` VARCHAR(80) DEFAULT NULL,
|
||||
`public_key` VARCHAR(2000) DEFAULT NULL,
|
||||
`private_key` VARCHAR(2000) DEFAULT NULL,
|
||||
`encryption_algorithm` VARCHAR(100) DEFAULT 'RS256'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
{{/hasOAuthMethods}}
|
@ -2,6 +2,7 @@ package {{package}}
|
||||
|
||||
import akka.http.scaladsl.server.Directives._
|
||||
import akka.http.scaladsl.server.Route
|
||||
import akka.http.scaladsl.model.StatusCodes
|
||||
{{^pathMatcherPatterns.isEmpty}}import akka.http.scaladsl.server.{PathMatcher, PathMatcher1}
|
||||
{{/pathMatcherPatterns.isEmpty}}
|
||||
{{#hasMarshalling}}import akka.http.scaladsl.marshalling.ToEntityMarshaller
|
||||
@ -63,8 +64,9 @@ object {{classname}}Patterns {
|
||||
trait {{classname}}Service {
|
||||
|
||||
{{#operation}}
|
||||
{{#responses}} def {{operationId}}{{#vendorExtensions.x-is-default}}Default{{/vendorExtensions.x-is-default}}{{^vendorExtensions.x-is-default}}{{code}}{{/vendorExtensions.x-is-default}}{{#baseType}}({{#vendorExtensions.x-is-default}}statusCode: Int, {{/vendorExtensions.x-is-default}}response{{baseType}}{{containerType}}: {{dataType}}){{^isPrimitiveType}}(implicit toEntityMarshaller{{baseType}}{{containerType}}: ToEntityMarshaller[{{dataType}}]){{/isPrimitiveType}}{{/baseType}}{{^baseType}}{{#vendorExtensions.x-is-default}}(statusCode: Int){{/vendorExtensions.x-is-default}}{{/baseType}}: Route =
|
||||
complete(({{#vendorExtensions.x-is-default}}statusCode{{/vendorExtensions.x-is-default}}{{^vendorExtensions.x-is-default}}{{code}}{{/vendorExtensions.x-is-default}}, {{#baseType}}response{{baseType}}{{containerType}}{{/baseType}}{{^baseType}}"{{message}}"{{/baseType}}))
|
||||
{{#responses}} def {{operationId}}{{#vendorExtensions.x-is-default}}Default{{/vendorExtensions.x-is-default}}{{^vendorExtensions.x-is-default}}{{code}}{{/vendorExtensions.x-is-default}}{{#baseType}}({{#vendorExtensions.x-is-default}}statusCode: Int, {{/vendorExtensions.x-is-default}}response{{baseType}}{{containerType}}: {{dataType}}){{^isPrimitiveType}}(implicit toEntityMarshaller{{baseType}}{{containerType}}: ToEntityMarshaller[{{dataType}}]){{/isPrimitiveType}}{{/baseType}}{{^baseType}}{{#vendorExtensions.x-is-default}}(statusCode: Int){{/vendorExtensions.x-is-default}}{{/baseType}}: Route ={{#vendorExtensions.x-empty-response}}
|
||||
complete({{#vendorExtensions.x-is-default}}statusCode{{/vendorExtensions.x-is-default}}{{^vendorExtensions.x-is-default}}StatusCodes.getForKey({{code}}){{/vendorExtensions.x-is-default}}){{/vendorExtensions.x-empty-response}}{{^vendorExtensions.x-empty-response}}
|
||||
complete(({{#vendorExtensions.x-is-default}}statusCode{{/vendorExtensions.x-is-default}}{{^vendorExtensions.x-is-default}}{{code}}{{/vendorExtensions.x-is-default}}, {{#baseType}}response{{baseType}}{{containerType}}{{/baseType}}{{^baseType}}"{{message}}"{{/baseType}})){{/vendorExtensions.x-empty-response}}
|
||||
{{/responses}}
|
||||
/**
|
||||
{{#responses}} * {{#code}}Code: {{.}}{{/code}}{{#message}}, Message: {{.}}{{/message}}{{#dataType}}, DataType: {{.}}{{/dataType}}
|
||||
|
@ -0,0 +1 @@
|
||||
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
|
@ -182,7 +182,7 @@ export class Configuration {
|
||||
}
|
||||
|
||||
export type Json = any;
|
||||
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
|
||||
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
||||
export type HTTPHeaders = { [key: string]: string };
|
||||
export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | HTTPQuery };
|
||||
export type HTTPBody = Json | FormData | URLSearchParams;
|
||||
|
@ -604,6 +604,37 @@ public class DefaultCodegenTest {
|
||||
Assert.assertEquals(getRequiredVars(childModel), Collections.singletonList("name"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllOfSingleAndDoubleRefWithOwnPropsNoDiscriminator() {
|
||||
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition.yaml");
|
||||
final DefaultCodegen codegen = new CodegenWithMultipleInheritance();
|
||||
|
||||
codegen.setOpenAPI(openAPI);
|
||||
|
||||
Schema supermanSchema = openAPI.getComponents().getSchemas().get("SuperMan");
|
||||
CodegenModel supermanModel = codegen.fromModel("SuperMan", supermanSchema);
|
||||
Assert.assertEquals(supermanModel.parent, null);
|
||||
Assert.assertEquals(supermanModel.allParents, null);
|
||||
|
||||
Schema superboySchema = openAPI.getComponents().getSchemas().get("SuperBoy");
|
||||
CodegenModel superboyModel = codegen.fromModel("SuperBoy", superboySchema);
|
||||
Assert.assertEquals(superboyModel.parent, null);
|
||||
Assert.assertEquals(superboyModel.allParents, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllParents() {
|
||||
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOfMappingDuplicatedProperties.yaml");
|
||||
final DefaultCodegen codegen = new CodegenWithMultipleInheritance();
|
||||
|
||||
codegen.setOpenAPI(openAPI);
|
||||
|
||||
Schema adultSchema = openAPI.getComponents().getSchemas().get("Adult");
|
||||
CodegenModel adultModel = codegen.fromModel("Adult", adultSchema);
|
||||
Assert.assertEquals(adultModel.parent, "Person");
|
||||
Assert.assertEquals(adultModel.allParents, Collections.singletonList("Person"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllOfSingleRefNoOwnProps() {
|
||||
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml");
|
||||
@ -774,6 +805,19 @@ public class DefaultCodegenTest {
|
||||
Assert.assertTrue(property.isNullable);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeprecatedModel() {
|
||||
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/component-deprecated.yml");
|
||||
new InlineModelResolver().flatten(openAPI);
|
||||
final DefaultCodegen codegen = new DefaultCodegen();
|
||||
|
||||
CodegenModel codedenPetModel = codegen.fromModel("Pet", openAPI.getComponents().getSchemas().get("Pet"));
|
||||
Assert.assertTrue(codedenPetModel.isDeprecated);
|
||||
|
||||
CodegenModel codegenFoodModel = codegen.fromModel("Food", openAPI.getComponents().getSchemas().get("Food"));
|
||||
Assert.assertTrue(codegenFoodModel.isDeprecated);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeprecatedProperty() {
|
||||
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/property-deplicated.yaml");
|
||||
|
@ -26,6 +26,17 @@ paths:
|
||||
$ref: "#/components/schemas/SuperMan"
|
||||
components:
|
||||
schemas:
|
||||
SuperBoy: # to test single ref (Human) only
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Human'
|
||||
- type: object
|
||||
required:
|
||||
- level
|
||||
properties:
|
||||
category:
|
||||
type: string
|
||||
level:
|
||||
type: integer
|
||||
SuperMan:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Human'
|
||||
|
@ -0,0 +1,37 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Example
|
||||
license:
|
||||
name: MIT
|
||||
servers:
|
||||
- url: http://api.example.xyz/v1
|
||||
|
||||
components:
|
||||
schemas:
|
||||
Food:
|
||||
deprecated: true
|
||||
type: string
|
||||
enum:
|
||||
- dry
|
||||
- wet
|
||||
|
||||
Pet:
|
||||
title: a Pet
|
||||
deprecated: true
|
||||
description: A pet up for adoption
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- status
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
example: doggie
|
||||
status:
|
||||
type: string
|
||||
description: pet status
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- adopted
|
@ -689,6 +689,7 @@ components:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
pattern: '["A-Z]+-[0-9][0-9]'
|
||||
phone:
|
||||
type: string
|
||||
userStatus:
|
||||
|
1
pom.xml
1
pom.xml
@ -1319,6 +1319,7 @@
|
||||
<module>samples/client/petstore/java/resteasy</module>
|
||||
<module>samples/client/petstore/java/google-api-client</module>
|
||||
<module>samples/client/petstore/java/rest-assured</module>
|
||||
<module>samples/client/petstore/java/rest-assured-jackson</module>
|
||||
<module>samples/client/petstore/groovy</module>
|
||||
<!-- servers -->
|
||||
<module>samples/server/petstore/jaxrs-jersey</module>
|
||||
|
@ -112,6 +112,7 @@ Class | Method | HTTP request | Description
|
||||
<a name="documentation-for-authorization"></a>
|
||||
## Documentation for Authorization
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
<a name="api_key"></a>
|
||||
### api_key
|
||||
|
||||
|
@ -34,7 +34,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
@ -96,7 +95,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
@ -162,7 +160,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
@ -227,7 +224,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
@ -292,7 +288,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
@ -357,7 +352,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
@ -419,7 +413,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
@ -485,7 +478,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
|
||||
|
||||
|
@ -32,7 +32,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new StoreApi();
|
||||
var orderId = orderId_example; // string | ID of the order that needs to be deleted
|
||||
|
||||
@ -93,7 +92,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
|
||||
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
@ -156,7 +154,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new StoreApi();
|
||||
var orderId = 789; // long? | ID of pet that needs to be fetched
|
||||
|
||||
@ -216,7 +213,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new StoreApi();
|
||||
var body = new Order(); // Order | order placed for purchasing the pet
|
||||
|
||||
|
@ -36,7 +36,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
var body = new User(); // User | Created user object
|
||||
|
||||
@ -95,7 +94,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
var body = new List<User>(); // List<User> | List of user object
|
||||
|
||||
@ -154,7 +152,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
var body = new List<User>(); // List<User> | List of user object
|
||||
|
||||
@ -215,7 +212,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
var username = username_example; // string | The name that needs to be deleted
|
||||
|
||||
@ -274,7 +270,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
@ -334,7 +329,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
var username = username_example; // string | The user name for login
|
||||
var password = password_example; // string | The password for login in clear text
|
||||
@ -396,7 +390,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
|
||||
try
|
||||
@ -453,7 +446,6 @@ namespace Example
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new UserApi();
|
||||
var username = username_example; // string | name that need to be deleted
|
||||
var body = new User(); // User | Updated user object
|
||||
|
@ -261,11 +261,9 @@ namespace Org.OpenAPITools.Client
|
||||
{
|
||||
case "api_key":
|
||||
headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
|
||||
|
||||
break;
|
||||
case "petstore_auth":
|
||||
|
||||
//TODO support oauth
|
||||
headerParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||
break;
|
||||
default:
|
||||
//TODO show warning about security definition not found
|
||||
|
@ -37,6 +37,12 @@ namespace Org.OpenAPITools.Client
|
||||
/// <value>The password.</value>
|
||||
public static String Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the access token (Bearer/OAuth authentication).
|
||||
/// </summary>
|
||||
/// <value>The access token.</value>
|
||||
public static String AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the API key based on the authentication name.
|
||||
/// </summary>
|
||||
|
@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Client
|
||||
public static String SelectHeaderContentType(String[] contentTypes)
|
||||
{
|
||||
if (contentTypes.Length == 0)
|
||||
return "application/json";
|
||||
return null;
|
||||
|
||||
foreach (var contentType in contentTypes)
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Client
|
||||
public static String SelectHeaderContentType(String[] contentTypes)
|
||||
{
|
||||
if (contentTypes.Length == 0)
|
||||
return "application/json";
|
||||
return null;
|
||||
|
||||
foreach (var contentType in contentTypes)
|
||||
{
|
||||
|
21
samples/client/petstore/java/rest-assured-jackson/.gitignore
vendored
Normal file
21
samples/client/petstore/java/rest-assured-jackson/.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# exclude jar for gradle wrapper
|
||||
!gradle/wrapper/*.jar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
# build files
|
||||
**/target
|
||||
target
|
||||
.gradle
|
||||
build
|
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1 @@
|
||||
4.3.1-SNAPSHOT
|
@ -0,0 +1,22 @@
|
||||
#
|
||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||
#
|
||||
# Ref: https://docs.travis-ci.com/user/languages/java/
|
||||
#
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk12
|
||||
- openjdk11
|
||||
- openjdk10
|
||||
- openjdk9
|
||||
- openjdk8
|
||||
before_install:
|
||||
# ensure gradlew has proper permission
|
||||
- chmod a+x ./gradlew
|
||||
script:
|
||||
# test using maven
|
||||
#- mvn test
|
||||
# test using gradle
|
||||
- gradle test
|
||||
# test using sbt
|
||||
# - sbt test
|
43
samples/client/petstore/java/rest-assured-jackson/README.md
Normal file
43
samples/client/petstore/java/rest-assured-jackson/README.md
Normal file
@ -0,0 +1,43 @@
|
||||
# petstore-rest-assured-jackson
|
||||
|
||||
## Requirements
|
||||
|
||||
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
|
||||
|
||||
## Installation & Usage
|
||||
|
||||
To install the API client library to your local Maven repository, simply execute:
|
||||
|
||||
```shell
|
||||
mvn install
|
||||
```
|
||||
|
||||
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
|
||||
|
||||
```shell
|
||||
mvn deploy
|
||||
```
|
||||
|
||||
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
|
||||
|
||||
After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>petstore-rest-assured-jackson</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
```
|
||||
|
||||
## Recommendation
|
||||
|
||||
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
|
||||
|
2183
samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml
Normal file
2183
samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml
Normal file
File diff suppressed because it is too large
Load Diff
121
samples/client/petstore/java/rest-assured-jackson/build.gradle
Normal file
121
samples/client/petstore/java/rest-assured-jackson/build.gradle
Normal file
@ -0,0 +1,121 @@
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
group = 'org.openapitools'
|
||||
version = '1.0.0'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url "https://repo1.maven.org/maven2" }
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.5.+'
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
|
||||
if(hasProperty('target') && target == 'android') {
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion '23.0.2'
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 22
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
// Rename the aar correctly
|
||||
libraryVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile != null && outputFile.name.endsWith('.aar')) {
|
||||
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
|
||||
output.outputFile = new File(outputFile.parent, fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
provided 'javax.annotation:jsr250-api:1.0'
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
android.libraryVariants.all { variant ->
|
||||
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
|
||||
task.description = "Create jar artifact for ${variant.name}"
|
||||
task.dependsOn variant.javaCompile
|
||||
task.from variant.javaCompile.destinationDir
|
||||
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
|
||||
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
|
||||
artifacts.add('archives', task);
|
||||
}
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
classifier = 'sources'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
install {
|
||||
repositories.mavenInstaller {
|
||||
pom.artifactId = 'petstore-rest-assured-jackson'
|
||||
}
|
||||
}
|
||||
|
||||
task execute(type:JavaExec) {
|
||||
main = System.getProperty('mainClass')
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.21"
|
||||
rest_assured_version = "4.3.0"
|
||||
junit_version = "4.13"
|
||||
jackson_version = "2.10.3"
|
||||
jackson_databind_version = "2.10.3"
|
||||
jackson_databind_nullable_version = "0.2.1"
|
||||
okio_version = "1.17.5"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||
compile "com.google.code.findbugs:jsr305:3.0.2"
|
||||
compile "io.rest-assured:rest-assured:$rest_assured_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
|
||||
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
|
||||
compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
|
||||
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||||
compile "com.squareup.okio:okio:$okio_version"
|
||||
compile "javax.validation:validation-api:2.0.1.Final"
|
||||
compile "org.hibernate:hibernate-validator:6.0.19.Final"
|
||||
testCompile "junit:junit:$junit_version"
|
||||
}
|
27
samples/client/petstore/java/rest-assured-jackson/build.sbt
Normal file
27
samples/client/petstore/java/rest-assured-jackson/build.sbt
Normal file
@ -0,0 +1,27 @@
|
||||
lazy val root = (project in file(".")).
|
||||
settings(
|
||||
organization := "org.openapitools",
|
||||
name := "petstore-rest-assured-jackson",
|
||||
version := "1.0.0",
|
||||
scalaVersion := "2.11.4",
|
||||
scalacOptions ++= Seq("-feature"),
|
||||
javacOptions in compile ++= Seq("-Xlint:deprecation"),
|
||||
publishArtifact in (Compile, packageDoc) := false,
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
"io.swagger" % "swagger-annotations" % "1.5.21",
|
||||
"io.rest-assured" % "rest-assured" % "4.3.0",
|
||||
"io.rest-assured" % "scala-support" % "4.3.0",
|
||||
"com.google.code.findbugs" % "jsr305" % "3.0.2",
|
||||
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3",
|
||||
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3",
|
||||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.1",
|
||||
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3",
|
||||
"com.squareup.okio" % "okio" % "1.17.5" % "compile",
|
||||
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
|
||||
"org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
|
||||
"junit" % "junit" % "4.13" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||
)
|
||||
)
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesAnyType
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesArray
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesBoolean
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapString** | **Map<String, String>** | | [optional]
|
||||
**mapNumber** | [**Map<String, BigDecimal>**](BigDecimal.md) | | [optional]
|
||||
**mapInteger** | **Map<String, Integer>** | | [optional]
|
||||
**mapBoolean** | **Map<String, Boolean>** | | [optional]
|
||||
**mapArrayInteger** | [**Map<String, List<Integer>>**](List.md) | | [optional]
|
||||
**mapArrayAnytype** | [**Map<String, List<Object>>**](List.md) | | [optional]
|
||||
**mapMapString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
|
||||
**mapMapAnytype** | [**Map<String, Map<String, Object>>**](Map.md) | | [optional]
|
||||
**anytype1** | [**Object**](.md) | | [optional]
|
||||
**anytype2** | [**Object**](.md) | | [optional]
|
||||
**anytype3** | [**Object**](.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesInteger
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesNumber
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesObject
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesString
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# Animal
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**className** | **String** | |
|
||||
**color** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,51 @@
|
||||
# AnotherFakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
|
||||
|
||||
<a name="call123testSpecialTags"></a>
|
||||
# **call123testSpecialTags**
|
||||
> Client call123testSpecialTags(body)
|
||||
|
||||
To test special tags
|
||||
|
||||
To test special tags and operation ID starting with number
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
AnotherFakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).anotherFake();
|
||||
|
||||
api.call123testSpecialTags()
|
||||
.body(body).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# ArrayOfArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# ArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ArrayTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayOfString** | **List<String>** | | [optional]
|
||||
**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional]
|
||||
**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# BigCat
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**kind** | [**KindEnum**](#KindEnum) | | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: KindEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
LIONS | "lions"
|
||||
TIGERS | "tigers"
|
||||
LEOPARDS | "leopards"
|
||||
JAGUARS | "jaguars"
|
||||
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# BigCatAllOf
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**kind** | [**KindEnum**](#KindEnum) | | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: KindEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
LIONS | "lions"
|
||||
TIGERS | "tigers"
|
||||
LEOPARDS | "leopards"
|
||||
JAGUARS | "jaguars"
|
||||
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
# Capitalization
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**smallCamel** | **String** | | [optional]
|
||||
**capitalCamel** | **String** | | [optional]
|
||||
**smallSnake** | **String** | | [optional]
|
||||
**capitalSnake** | **String** | | [optional]
|
||||
**scAETHFlowPoints** | **String** | | [optional]
|
||||
**ATT_NAME** | **String** | Name of the pet | [optional]
|
||||
|
||||
|
||||
|
@ -1,9 +1,12 @@
|
||||
|
||||
# StringBooleanMap
|
||||
|
||||
# Cat
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**declawed** | **Boolean** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# CatAllOf
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**declawed** | **Boolean** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# Category
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Long** | | [optional]
|
||||
**name** | **String** | |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ClassModel
|
||||
|
||||
Model for testing model with \"_class\" property
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**propertyClass** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -1,9 +1,12 @@
|
||||
|
||||
# AnimalFarm
|
||||
|
||||
# Dog
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**breed** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# DogAllOf
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**breed** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
# EnumArrays
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
|
||||
**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: JustSymbolEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
GREATER_THAN_OR_EQUAL_TO | ">="
|
||||
DOLLAR | "$"
|
||||
|
||||
|
||||
|
||||
## Enum: List<ArrayEnumEnum>
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
FISH | "fish"
|
||||
CRAB | "crab"
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# EnumClass
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `_ABC` (value: `"_abc"`)
|
||||
|
||||
* `_EFG` (value: `"-efg"`)
|
||||
|
||||
* `_XYZ_` (value: `"(xyz)"`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,54 @@
|
||||
|
||||
|
||||
# EnumTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
|
||||
**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
|
||||
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
|
||||
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
|
||||
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: EnumStringEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
UPPER | "UPPER"
|
||||
LOWER | "lower"
|
||||
EMPTY | ""
|
||||
|
||||
|
||||
|
||||
## Enum: EnumStringRequiredEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
UPPER | "UPPER"
|
||||
LOWER | "lower"
|
||||
EMPTY | ""
|
||||
|
||||
|
||||
|
||||
## Enum: EnumIntegerEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
NUMBER_1 | 1
|
||||
NUMBER_MINUS_1 | -1
|
||||
|
||||
|
||||
|
||||
## Enum: EnumNumberEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
NUMBER_1_DOT_1 | 1.1
|
||||
NUMBER_MINUS_1_DOT_2 | -1.2
|
||||
|
||||
|
||||
|
@ -0,0 +1,641 @@
|
||||
# FakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem
|
||||
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
|
||||
|
||||
|
||||
<a name="createXmlItem"></a>
|
||||
# **createXmlItem**
|
||||
> createXmlItem(xmlItem)
|
||||
|
||||
creates an XmlItem
|
||||
|
||||
this route creates an XmlItem
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.createXmlItem()
|
||||
.body(xmlItem).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="fakeOuterBooleanSerialize"></a>
|
||||
# **fakeOuterBooleanSerialize**
|
||||
> Boolean fakeOuterBooleanSerialize(body)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer boolean types
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.fakeOuterBooleanSerialize().execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **Boolean**| Input boolean as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**Boolean**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterCompositeSerialize"></a>
|
||||
# **fakeOuterCompositeSerialize**
|
||||
> OuterComposite fakeOuterCompositeSerialize(body)
|
||||
|
||||
|
||||
|
||||
Test serialization of object with outer number type
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.fakeOuterCompositeSerialize().execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**OuterComposite**](OuterComposite.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterNumberSerialize"></a>
|
||||
# **fakeOuterNumberSerialize**
|
||||
> BigDecimal fakeOuterNumberSerialize(body)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer number types
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.fakeOuterNumberSerialize().execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **BigDecimal**| Input number as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**BigDecimal**](BigDecimal.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterStringSerialize"></a>
|
||||
# **fakeOuterStringSerialize**
|
||||
> String fakeOuterStringSerialize(body)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer string types
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.fakeOuterStringSerialize().execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **String**| Input string as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(body)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testBodyWithFileSchema()
|
||||
.body(body).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, body)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testBodyWithQueryParams()
|
||||
.queryQuery(query)
|
||||
.body(body).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**query** | **String**| |
|
||||
**body** | [**User**](User.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testClientModel()
|
||||
.body(body).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testEndpointParameters()
|
||||
.numberForm(number)
|
||||
._doubleForm(_double)
|
||||
.patternWithoutDelimiterForm(patternWithoutDelimiter)
|
||||
._byteForm(_byte).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**number** | **BigDecimal**| None |
|
||||
**_double** | **Double**| None |
|
||||
**patternWithoutDelimiter** | **String**| None |
|
||||
**_byte** | **byte[]**| None |
|
||||
**integer** | **Integer**| None | [optional]
|
||||
**int32** | **Integer**| None | [optional]
|
||||
**int64** | **Long**| None | [optional]
|
||||
**_float** | **Float**| None | [optional]
|
||||
**string** | **String**| None | [optional]
|
||||
**binary** | **File**| None | [optional]
|
||||
**date** | **LocalDate**| None | [optional]
|
||||
**dateTime** | **OffsetDateTime**| None | [optional]
|
||||
**password** | **String**| None | [optional]
|
||||
**paramCallback** | **String**| None | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_basic_test](../README.md#http_basic_test)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testEnumParameters"></a>
|
||||
# **testEnumParameters**
|
||||
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
|
||||
|
||||
To test enum parameters
|
||||
|
||||
To test enum parameters
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testEnumParameters().execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [default to new ArrayList<>()] [enum: >, $]
|
||||
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
**enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [default to new ArrayList<>()] [enum: >, $]
|
||||
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
**enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2]
|
||||
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
|
||||
**enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
|
||||
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testGroupParameters"></a>
|
||||
# **testGroupParameters**
|
||||
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testGroupParameters()
|
||||
.requiredStringGroupQuery(requiredStringGroup)
|
||||
.requiredBooleanGroupHeader(requiredBooleanGroup)
|
||||
.requiredInt64GroupQuery(requiredInt64Group).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**requiredStringGroup** | **Integer**| Required String in group parameters |
|
||||
**requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters |
|
||||
**requiredInt64Group** | **Long**| Required Integer in group parameters |
|
||||
**stringGroup** | **Integer**| String in group parameters | [optional]
|
||||
**booleanGroup** | **Boolean**| Boolean in group parameters | [optional]
|
||||
**int64Group** | **Long**| Integer in group parameters | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testInlineAdditionalProperties"></a>
|
||||
# **testInlineAdditionalProperties**
|
||||
> testInlineAdditionalProperties(param)
|
||||
|
||||
test inline additionalProperties
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testInlineAdditionalProperties()
|
||||
.body(param).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | [**Map<String, String>**](String.md)| request body |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testJsonFormData"></a>
|
||||
# **testJsonFormData**
|
||||
> testJsonFormData(param, param2)
|
||||
|
||||
test json serialization of form data
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testJsonFormData()
|
||||
.paramForm(param)
|
||||
.param2Form(param2).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **String**| field1 |
|
||||
**param2** | **String**| field2 |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testQueryParameterCollectionFormat"></a>
|
||||
# **testQueryParameterCollectionFormat**
|
||||
> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
|
||||
|
||||
|
||||
|
||||
To test the collection format in query parameters
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fake();
|
||||
|
||||
api.testQueryParameterCollectionFormat()
|
||||
.pipeQuery(pipe)
|
||||
.ioutilQuery(ioutil)
|
||||
.httpQuery(http)
|
||||
.urlQuery(url)
|
||||
.contextQuery(context).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pipe** | [**List<String>**](String.md)| | [default to new ArrayList<>()]
|
||||
**ioutil** | [**List<String>**](String.md)| | [default to new ArrayList<>()]
|
||||
**http** | [**List<String>**](String.md)| | [default to new ArrayList<>()]
|
||||
**url** | [**List<String>**](String.md)| | [default to new ArrayList<>()]
|
||||
**context** | [**List<String>**](String.md)| | [default to new ArrayList<>()]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
@ -0,0 +1,51 @@
|
||||
# FakeClassnameTags123Api
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
|
||||
|
||||
<a name="testClassname"></a>
|
||||
# **testClassname**
|
||||
> Client testClassname(body)
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
FakeClassnameTags123Api api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).fakeClassnameTags123();
|
||||
|
||||
api.testClassname()
|
||||
.body(body).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key_query](../README.md#api_key_query)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# FormatTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**integer** | **Integer** | | [optional]
|
||||
**int32** | **Integer** | | [optional]
|
||||
**int64** | **Long** | | [optional]
|
||||
**number** | [**BigDecimal**](BigDecimal.md) | |
|
||||
**_float** | **Float** | | [optional]
|
||||
**_double** | **Double** | | [optional]
|
||||
**string** | **String** | | [optional]
|
||||
**_byte** | **byte[]** | |
|
||||
**binary** | [**File**](File.md) | | [optional]
|
||||
**date** | [**LocalDate**](LocalDate.md) | |
|
||||
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||
**uuid** | [**UUID**](UUID.md) | | [optional]
|
||||
**password** | **String** | |
|
||||
**bigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# HasOnlyReadOnly
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional] [readonly]
|
||||
**foo** | **String** | | [optional] [readonly]
|
||||
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# MapTest
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
|
||||
**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
|
||||
**directMap** | **Map<String, Boolean>** | | [optional]
|
||||
**indirectMap** | **Map<String, Boolean>** | | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: Map<String, InnerEnum>
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
UPPER | "UPPER"
|
||||
LOWER | "lower"
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# MixedPropertiesAndAdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**uuid** | [**UUID**](UUID.md) | | [optional]
|
||||
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||
**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# Model200Response
|
||||
|
||||
Model for testing model name starting with number
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | | [optional]
|
||||
**propertyClass** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelApiResponse
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **Integer** | | [optional]
|
||||
**type** | **String** | | [optional]
|
||||
**message** | **String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelReturn
|
||||
|
||||
Model for testing reserved words
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_return** | **Integer** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# Name
|
||||
|
||||
Model for testing model name same as property name
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | |
|
||||
**snakeCase** | **Integer** | | [optional] [readonly]
|
||||
**property** | **String** | | [optional]
|
||||
**_123number** | **Integer** | | [optional] [readonly]
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
# NumberOnly
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
# Order
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Long** | | [optional]
|
||||
**petId** | **Long** | | [optional]
|
||||
**quantity** | **Integer** | | [optional]
|
||||
**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||
**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
|
||||
**complete** | **Boolean** | | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: StatusEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
PLACED | "placed"
|
||||
APPROVED | "approved"
|
||||
DELIVERED | "delivered"
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# OuterComposite
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
**myString** | **String** | | [optional]
|
||||
**myBoolean** | **Boolean** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# OuterEnum
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `PLACED` (value: `"placed"`)
|
||||
|
||||
* `APPROVED` (value: `"approved"`)
|
||||
|
||||
* `DELIVERED` (value: `"delivered"`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
# Pet
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Long** | | [optional]
|
||||
**category** | [**Category**](Category.md) | | [optional]
|
||||
**name** | **String** | |
|
||||
**photoUrls** | **List<String>** | |
|
||||
**tags** | [**List<Tag>**](Tag.md) | | [optional]
|
||||
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: StatusEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
AVAILABLE | "available"
|
||||
PENDING | "pending"
|
||||
SOLD | "sold"
|
||||
|
||||
|
||||
|
391
samples/client/petstore/java/rest-assured-jackson/docs/PetApi.md
Normal file
391
samples/client/petstore/java/rest-assured-jackson/docs/PetApi.md
Normal file
@ -0,0 +1,391 @@
|
||||
# PetApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
|
||||
|
||||
<a name="addPet"></a>
|
||||
# **addPet**
|
||||
> addPet(body)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.addPet()
|
||||
.body(body).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="deletePet"></a>
|
||||
# **deletePet**
|
||||
> deletePet(petId, apiKey)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.deletePet()
|
||||
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| Pet id to delete |
|
||||
**apiKey** | **String**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="findPetsByStatus"></a>
|
||||
# **findPetsByStatus**
|
||||
> List<Pet> findPetsByStatus(status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.findPetsByStatus()
|
||||
.statusQuery(status).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to new ArrayList<>()] [enum: available, pending, sold]
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="findPetsByTags"></a>
|
||||
# **findPetsByTags**
|
||||
> List<Pet> findPetsByTags(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.findPetsByTags()
|
||||
.tagsQuery(tags).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**List<String>**](String.md)| Tags to filter by | [default to new ArrayList<>()]
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="getPetById"></a>
|
||||
# **getPetById**
|
||||
> Pet getPetById(petId)
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.getPetById()
|
||||
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="updatePet"></a>
|
||||
# **updatePet**
|
||||
> updatePet(body)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.updatePet()
|
||||
.body(body).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="updatePetWithForm"></a>
|
||||
# **updatePetWithForm**
|
||||
> updatePetWithForm(petId, name, status)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.updatePetWithForm()
|
||||
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
|
||||
uploads an image
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.uploadFile()
|
||||
.petIdPath(petId).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
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]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ModelApiResponse**](ModelApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="uploadFileWithRequiredFile"></a>
|
||||
# **uploadFileWithRequiredFile**
|
||||
> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
|
||||
|
||||
uploads an image (required)
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import org.openapitools.client.ApiClient;
|
||||
//import io.restassured.builder.RequestSpecBuilder;
|
||||
//import io.restassured.filter.log.ErrorLoggingFilter;
|
||||
|
||||
PetApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier(
|
||||
() -> new RequestSpecBuilder()
|
||||
.setBaseUri("http://petstore.swagger.io:80/v2"))).pet();
|
||||
|
||||
api.uploadFileWithRequiredFile()
|
||||
.petIdPath(petId)
|
||||
.requiredFileMultiPart(requiredFile).execute(r -> r.prettyPeek());
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**requiredFile** | **File**| file to upload |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ModelApiResponse**](ModelApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
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