Merge remote-tracking branch 'origin/master' into 5.0.x-sync-master4

This commit is contained in:
William Cheng 2020-04-22 12:15:45 +08:00
commit 47a9294a99
315 changed files with 24228 additions and 521 deletions

View File

@ -567,6 +567,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Adaptant Solutions AG](https://www.adaptant.io/) - [Adaptant Solutions AG](https://www.adaptant.io/)
- [Agoda](https://www.agoda.com/) - [Agoda](https://www.agoda.com/)
- [Allianz](https://www.allianz.com)
- [Angular.Schule](https://angular.schule/) - [Angular.Schule](https://angular.schule/)
- [Australia and New Zealand Banking Group (ANZ)](http://www.anz.com/) - [Australia and New Zealand Banking Group (ANZ)](http://www.anz.com/)
- [ASKUL](https://www.askul.co.jp) - [ASKUL](https://www.askul.co.jp)

View 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"
}
}

View File

@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" 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 java $JAVA_OPTS -jar $executable $ags

View File

@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" 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 java $JAVA_OPTS -jar $executable $ags

View File

@ -12,6 +12,7 @@
./bin/java-petstore-okhttp-gson-parcelable.sh ./bin/java-petstore-okhttp-gson-parcelable.sh
./bin/java-petstore-okhttp-gson.sh ./bin/java-petstore-okhttp-gson.sh
./bin/java-petstore-rest-assured.sh ./bin/java-petstore-rest-assured.sh
./bin/java-petstore-rest-assured-jackson.sh
./bin/java-petstore-resteasy.sh ./bin/java-petstore-resteasy.sh
./bin/java-petstore-resttemplate-withxml.sh ./bin/java-petstore-resttemplate-withxml.sh
./bin/java-petstore-resttemplate.sh ./bin/java-petstore-resttemplate.sh

View File

@ -0,0 +1,4 @@
{
"library": "rest-assured",
"artifactId": "petstore-rest-assured-jackson"
}

View 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

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M 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% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -20,4 +20,5 @@ call .\bin\windows\java-petstore-webclient.bat
call .\bin\windows\java-petstore-resteasy.bat call .\bin\windows\java-petstore-resteasy.bat
call .\bin\windows\java-petstore-google-api-client.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.bat
call .\bin\windows\java-petstore-rest-assured-jackson.bat
call .\bin\windows\java-petstore-vertx.bat call .\bin\windows\java-petstore-vertx.bat

View 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%

View File

@ -640,7 +640,7 @@ open class GenerateTask : DefaultTask() {
DefaultGenerator().opts(clientOptInput).generate() DefaultGenerator().opts(clientOptInput).generate()
out.println("Successfully generated code to $outputDir") out.println("Successfully generated code to ${outputDir.get()}")
} catch (e: RuntimeException) { } catch (e: RuntimeException) {
throw GradleException("Code generation failed.", e) throw GradleException("Code generation failed.", e)
} }

View File

@ -70,7 +70,7 @@ import com.google.common.io.Files;
* Goal which generates client/server code from a OpenAPI json/yaml definition. * Goal which generates client/server code from a OpenAPI json/yaml definition.
*/ */
@SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"}) @SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"})
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES) @Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
public class CodeGenMojo extends AbstractMojo { public class CodeGenMojo extends AbstractMojo {
private static final Logger LOGGER = LoggerFactory.getLogger(CodeGenMojo.class); private static final Logger LOGGER = LoggerFactory.getLogger(CodeGenMojo.class);

View File

@ -74,7 +74,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public Set<String> allMandatory = new TreeSet<String>(); // with parent's required properties public Set<String> allMandatory = new TreeSet<String>(); // with parent's required properties
public Set<String> imports = new TreeSet<String>(); 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 boolean hasOnlyReadOnly = true; // true if all properties are read-only
public ExternalDocumentation externalDocumentation; public ExternalDocumentation externalDocumentation;
@ -543,6 +543,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
isArrayModel == that.isArrayModel && isArrayModel == that.isArrayModel &&
hasChildren == that.hasChildren && hasChildren == that.hasChildren &&
isMapModel == that.isMapModel && isMapModel == that.isMapModel &&
isDeprecated == that.isDeprecated &&
hasOnlyReadOnly == that.hasOnlyReadOnly && hasOnlyReadOnly == that.hasOnlyReadOnly &&
getUniqueItems() == that.getUniqueItems() && getUniqueItems() == that.getUniqueItems() &&
getExclusiveMinimum() == that.getExclusiveMinimum() && getExclusiveMinimum() == that.getExclusiveMinimum() &&
@ -609,7 +610,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
getVars(), getAllVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(), getVars(), getAllVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(),
getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars, getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars,
isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArrayModel, isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArrayModel,
hasChildren, isMapModel, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(), hasChildren, isMapModel, isDeprecated, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(),
getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(), getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(),
getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(), getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(),
getMaximum(), getPattern(), getMultipleOf()); getMaximum(), getPattern(), getMultipleOf());
@ -673,6 +674,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
sb.append(", isArrayModel=").append(isArrayModel); sb.append(", isArrayModel=").append(isArrayModel);
sb.append(", hasChildren=").append(hasChildren); sb.append(", hasChildren=").append(hasChildren);
sb.append(", isMapModel=").append(isMapModel); sb.append(", isMapModel=").append(isMapModel);
sb.append(", isDeprecated=").append(isDeprecated);
sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly); sb.append(", hasOnlyReadOnly=").append(hasOnlyReadOnly);
sb.append(", externalDocumentation=").append(externalDocumentation); sb.append(", externalDocumentation=").append(externalDocumentation);
sb.append(", vendorExtensions=").append(vendorExtensions); sb.append(", vendorExtensions=").append(vendorExtensions);

View File

@ -2134,6 +2134,10 @@ public class DefaultCodegen implements CodegenConfig {
|| isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types || isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types
m.discriminator = createDiscriminator(name, schema); m.discriminator = createDiscriminator(name, schema);
if (schema.getDeprecated() != null) {
m.isDeprecated = schema.getDeprecated();
}
if (schema.getXml() != null) { if (schema.getXml() != null) {
m.xmlPrefix = schema.getXml().getPrefix(); m.xmlPrefix = schema.getXml().getPrefix();
m.xmlNamespace = schema.getXml().getNamespace(); m.xmlNamespace = schema.getXml().getNamespace();
@ -5539,6 +5543,8 @@ public class DefaultCodegen implements CodegenConfig {
setParameterNullable(codegenParameter, codegenProperty); setParameterNullable(codegenParameter, codegenProperty);
} }
addJsonSchemaForBodyRequestInCaseItsNotPresent(codegenParameter, body);
// set the parameter's example value // set the parameter's example value
// should be overridden by lang codegen // should be overridden by lang codegen
setParameterExampleValue(codegenParameter, body); setParameterExampleValue(codegenParameter, body);
@ -5546,6 +5552,11 @@ public class DefaultCodegen implements CodegenConfig {
return codegenParameter; 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) { protected void addOption(String key, String description, String defaultValue) {
CliOption option = new CliOption(key, description); CliOption option = new CliOption(key, description);
if (defaultValue != null) if (defaultValue != null)

View File

@ -332,11 +332,11 @@ public class InlineModelResolver {
* Flattens properties of inline object schemas that belong to a composed schema into a * Flattens properties of inline object schemas that belong to a composed schema into a
* single flat list of properties. This is useful to generate a single or multiple * single flat list of properties. This is useful to generate a single or multiple
* inheritance model. * inheritance model.
* *
* In the example below, codegen may generate a 'Dog' class that extends from the * In the example below, codegen may generate a 'Dog' class that extends from the
* generated 'Animal' class. 'Dog' has additional properties 'name', 'age' and 'breed' that * generated 'Animal' class. 'Dog' has additional properties 'name', 'age' and 'breed' that
* are flattened as a single list of properties. * are flattened as a single list of properties.
* *
* Dog: * Dog:
* allOf: * allOf:
* - $ref: '#/components/schemas/Animal' * - $ref: '#/components/schemas/Animal'
@ -350,7 +350,7 @@ public class InlineModelResolver {
* properties: * properties:
* breed: * breed:
* type: string * type: string
* *
* @param openAPI the OpenAPI document * @param openAPI the OpenAPI document
* @param key a unique name ofr the composed schema. * @param key a unique name ofr the composed schema.
* @param children the list of nested schemas within a composed schema (allOf, anyOf, oneOf). * @param children the list of nested schemas within a composed schema (allOf, anyOf, oneOf).
@ -362,8 +362,10 @@ public class InlineModelResolver {
ListIterator<Schema> listIterator = children.listIterator(); ListIterator<Schema> listIterator = children.listIterator();
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
Schema component = listIterator.next(); Schema component = listIterator.next();
if (component instanceof ObjectSchema) { if (component instanceof ObjectSchema || // for inline schema with type:object
ObjectSchema op = (ObjectSchema) component; (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 (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 // 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. // inline schema. Otherwise, we'll use the default naming such as InlineObject1, etc.
@ -390,6 +392,8 @@ public class InlineModelResolver {
listIterator.set(schema); listIterator.set(schema);
} }
} }
} else {
// likely a reference to schema (not inline schema)
} }
} }
} }
@ -465,7 +469,7 @@ public class InlineModelResolver {
* with underscores * with underscores
* *
* e.g. io.schema.User_name => io_schema_User_name * e.g. io.schema.User_name => io_schema_User_name
* *
* @param title String title field in the schema if present * @param title String title field in the schema if present
* @param key String model name * @param key String model name
* *
@ -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 description = object.getDescription();
String example = null; String example = null;
Object obj = object.getExample(); Object obj = object.getExample();

View File

@ -79,69 +79,74 @@ public class CodegenConfigurator {
public static CodegenConfigurator fromFile(String configFile, Module... modules) { public static CodegenConfigurator fromFile(String configFile, Module... modules) {
if (isNotEmpty(configFile)) { if (isNotEmpty(configFile)) {
ObjectMapper mapper; DynamicSettings settings = readDynamicSettings(configFile, modules);
if (FilenameUtils.isExtension(configFile, new String[]{"yml", "yaml"})) { CodegenConfigurator configurator = new CodegenConfigurator();
mapper = Yaml.mapper();
} else { GeneratorSettings generatorSettings = settings.getGeneratorSettings();
mapper = Json.mapper(); WorkflowSettings workflowSettings = settings.getWorkflowSettings();
// We copy "cached" properties into configurator so it is appropriately configured with all settings in external files.
// FIXME: target is to eventually move away from CodegenConfigurator properties except gen/workflow settings.
configurator.generatorName = generatorSettings.getGeneratorName();
configurator.inputSpec = workflowSettings.getInputSpec();
configurator.templatingEngineName = workflowSettings.getTemplatingEngineName();
if (workflowSettings.getSystemProperties() != null) {
configurator.systemProperties.putAll(workflowSettings.getSystemProperties());
}
if(generatorSettings.getInstantiationTypes() != null) {
configurator.instantiationTypes.putAll(generatorSettings.getInstantiationTypes());
}
if(generatorSettings.getTypeMappings() != null) {
configurator.typeMappings.putAll(generatorSettings.getTypeMappings());
}
if(generatorSettings.getAdditionalProperties() != null) {
configurator.additionalProperties.putAll(generatorSettings.getAdditionalProperties());
}
if(generatorSettings.getImportMappings() != null) {
configurator.importMappings.putAll(generatorSettings.getImportMappings());
}
if(generatorSettings.getLanguageSpecificPrimitives() != null) {
configurator.languageSpecificPrimitives.addAll(generatorSettings.getLanguageSpecificPrimitives());
}
if(generatorSettings.getReservedWordMappings() != null) {
configurator.reservedWordMappings.putAll(generatorSettings.getReservedWordMappings());
}
if(generatorSettings.getServerVariables() != null) {
configurator.serverVariables.putAll(generatorSettings.getServerVariables());
} }
if (modules != null && modules.length > 0) { configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(generatorSettings);
mapper.registerModules(modules); configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(workflowSettings);
}
mapper.registerModule(new GuavaModule()); return configurator;
try {
DynamicSettings settings = mapper.readValue(new File(configFile), DynamicSettings.class);
CodegenConfigurator configurator = new CodegenConfigurator();
GeneratorSettings generatorSettings = settings.getGeneratorSettings();
WorkflowSettings workflowSettings = settings.getWorkflowSettings();
// We copy "cached" properties into configurator so it is appropriately configured with all settings in external files.
// FIXME: target is to eventually move away from CodegenConfigurator properties except gen/workflow settings.
configurator.generatorName = generatorSettings.getGeneratorName();
configurator.inputSpec = workflowSettings.getInputSpec();
configurator.templatingEngineName = workflowSettings.getTemplatingEngineName();
if (workflowSettings.getSystemProperties() != null) {
configurator.systemProperties.putAll(workflowSettings.getSystemProperties());
}
if(generatorSettings.getInstantiationTypes() != null) {
configurator.instantiationTypes.putAll(generatorSettings.getInstantiationTypes());
}
if(generatorSettings.getTypeMappings() != null) {
configurator.typeMappings.putAll(generatorSettings.getTypeMappings());
}
if(generatorSettings.getAdditionalProperties() != null) {
configurator.additionalProperties.putAll(generatorSettings.getAdditionalProperties());
}
if(generatorSettings.getImportMappings() != null) {
configurator.importMappings.putAll(generatorSettings.getImportMappings());
}
if(generatorSettings.getLanguageSpecificPrimitives() != null) {
configurator.languageSpecificPrimitives.addAll(generatorSettings.getLanguageSpecificPrimitives());
}
if(generatorSettings.getReservedWordMappings() != null) {
configurator.reservedWordMappings.putAll(generatorSettings.getReservedWordMappings());
}
if(generatorSettings.getServerVariables() != null) {
configurator.serverVariables.putAll(generatorSettings.getServerVariables());
}
configurator.generatorSettingsBuilder = GeneratorSettings.newBuilder(generatorSettings);
configurator.workflowSettingsBuilder = WorkflowSettings.newBuilder(workflowSettings);
return configurator;
} catch (IOException ex) {
LOGGER.error(ex.getMessage());
throw new RuntimeException("Unable to deserialize config file: " + configFile);
}
} }
return null; 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);
}
}
public CodegenConfigurator addServerVariable(String key, String value) { public CodegenConfigurator addServerVariable(String key, String value) {
this.serverVariables.put(key, value); this.serverVariables.put(key, value);
generatorSettingsBuilder.withServerVariable(key, value); generatorSettingsBuilder.withServerVariable(key, value);

View File

@ -19,6 +19,7 @@ package org.openapitools.codegen.languages;
import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.ArraySchema;
import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.Schema;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*; import org.openapitools.codegen.*;
import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.GeneratorMetadata;
@ -622,6 +623,28 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml")); 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 @Override
public String escapeUnsafeCharacters(String input) { public String escapeUnsafeCharacters(String input) {
return input.replace("#>", "#_>").replace("<#", "<_#"); return input.replace("#>", "#_>").replace("<#", "<_#");

View File

@ -409,6 +409,7 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements
entityMarshallerTypes.add(marshaller); entityMarshallerTypes.add(marshaller);
operationSpecificMarshallers.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")); response.vendorExtensions.put("x-is-default", response.code.equals("0"));
} }
op.vendorExtensions.put("x-specific-marshallers", operationSpecificMarshallers); op.vendorExtensions.put("x-specific-marshallers", operationSpecificMarshallers);

View File

@ -110,6 +110,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts")); supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts"));
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
supportingFiles.add(new SupportingFile("npmignore", "", ".npmignore"));
if (additionalProperties.containsKey(SEPARATE_MODELS_AND_API)) { if (additionalProperties.containsKey(SEPARATE_MODELS_AND_API)) {
boolean separateModelsAndApi = Boolean.parseBoolean(additionalProperties.get(SEPARATE_MODELS_AND_API).toString()); boolean separateModelsAndApi = Boolean.parseBoolean(additionalProperties.get(SEPARATE_MODELS_AND_API).toString());

View File

@ -1104,9 +1104,9 @@ public class ModelUtils {
public static Map<String, List<String>> getChildrenMap(OpenAPI openAPI) { public static Map<String, List<String>> getChildrenMap(OpenAPI openAPI) {
Map<String, Schema> allSchemas = getSchemas(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() Map<String, List<Entry<String, Schema>>> groupedByParent = allSchemas.entrySet().stream()
.filter(entry -> isComposedSchema(entry.getValue())) .filter(entry -> isComposedSchema(entry.getValue()))
.filter(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas)!=null)
.collect(Collectors.groupingBy(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas))); .collect(Collectors.groupingBy(entry -> getParentName((ComposedSchema) entry.getValue(), allSchemas)));
return groupedByParent.entrySet().stream() return groupedByParent.entrySet().stream()
@ -1165,14 +1165,6 @@ public class ModelUtils {
int nullSchemaChildrenCount = 0; int nullSchemaChildrenCount = 0;
boolean hasAmbiguousParents = false; boolean hasAmbiguousParents = false;
List<String> refedWithoutDiscriminator = new ArrayList<>(); 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()) { if (interfaces != null && !interfaces.isEmpty()) {
for (Schema schema : interfaces) { for (Schema schema : interfaces) {
@ -1189,10 +1181,7 @@ public class ModelUtils {
} else { } else {
// not a parent since discriminator.propertyName is not set // not a parent since discriminator.propertyName is not set
hasAmbiguousParents = true; hasAmbiguousParents = true;
boolean isNotExtractedInlineSchema = !parentName.equals(schemaName+"_allOf"); refedWithoutDiscriminator.add(parentName);
if (isNotExtractedInlineSchema) {
refedWithoutDiscriminator.add(parentName);
}
} }
} else { } else {
// not a ref, doing nothing, except counting the number of times the 'null' type // not a ref, doing nothing, except counting the number of times the 'null' type
@ -1236,7 +1225,6 @@ public class ModelUtils {
public static List<String> getAllParentsName(ComposedSchema composedSchema, Map<String, Schema> allSchemas, boolean includeAncestors) { public static List<String> getAllParentsName(ComposedSchema composedSchema, Map<String, Schema> allSchemas, boolean includeAncestors) {
List<Schema> interfaces = getInterfaces(composedSchema); List<Schema> interfaces = getInterfaces(composedSchema);
List<String> names = new ArrayList<String>(); List<String> names = new ArrayList<String>();
List<String> refedWithoutDiscriminator = new ArrayList<>();
if (interfaces != null && !interfaces.isEmpty()) { if (interfaces != null && !interfaces.isEmpty()) {
for (Schema schema : interfaces) { for (Schema schema : interfaces) {
@ -1255,7 +1243,6 @@ public class ModelUtils {
} }
} else { } else {
// not a parent since discriminator.propertyName is not set // not a parent since discriminator.propertyName is not set
refedWithoutDiscriminator.add(parentName);
} }
} else { } else {
// not a ref, doing nothing // not a ref, doing nothing
@ -1263,10 +1250,11 @@ public class ModelUtils {
} }
} }
if (names.size() == 0 && refedWithoutDiscriminator.size() == 1) { // ensure `allParents` always includes `parent`
LOGGER.warn("[deprecated] inheritance without use of 'discriminator.propertyName' is deprecated " + // this is more robust than keeping logic in getParentName() and getAllParentsName() in sync
"and will be removed in a future release. Generating model for {}. Title: {}", composedSchema.getName(), composedSchema.getTitle()); String parentName = getParentName(composedSchema, allSchemas);
return refedWithoutDiscriminator; if (parentName != null && !names.contains(parentName)) {
names.add(parentName);
} }
return names; return names;

View File

@ -101,7 +101,10 @@ ext {
{{#jackson}} {{#jackson}}
jackson_version = "2.10.3" jackson_version = "2.10.3"
jackson_databind_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}} {{/jackson}}
{{#gson}} {{#gson}}
gson_version = "2.8.6" gson_version = "2.8.6"
@ -119,13 +122,25 @@ ext {
dependencies { dependencies {
compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "com.google.code.findbugs:jsr305:3.0.2" 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}} {{#jackson}}
compile "com.fasterxml.jackson.core:jackson-core:$jackson_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-annotations:$jackson_version"
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_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}} {{/jackson}}
{{#gson}} {{#gson}}
compile "io.gsonfire:gson-fire:$gson_fire_version" compile "io.gsonfire:gson-fire:$gson_fire_version"

View File

@ -10,11 +10,26 @@ lazy val root = (project in file(".")).
resolvers += Resolver.mavenLocal, resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.5.21", "io.swagger" % "swagger-annotations" % "1.5.21",
"io.rest-assured" % "rest-assured" % "4.3.0",
"io.rest-assured" % "scala-support" % "4.3.0", "io.rest-assured" % "scala-support" % "4.3.0",
"com.google.code.findbugs" % "jsr305" % "3.0.2",
{{#jackson}} {{#jackson}}
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", "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}} {{/jackson}}
{{#gson}} {{#gson}}
"com.google.code.gson" % "gson" % "2.8.6", "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", "javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
{{/useBeanValidation}} {{/useBeanValidation}}
{{#performBeanValidation}} {{#performBeanValidation}}
"org.hibernate" % "hibernate-validator" "6.0.19.Final" % "compile", "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile",
{{/performBeanValidation}} {{/performBeanValidation}}
"junit" % "junit" % "4.13" % "test", "junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test" "com.novocode" % "junit-interface" % "0.10" % "test"

View File

@ -261,8 +261,25 @@ namespace {{clientPackage}}
{ {
{{#authMethods}} {{#authMethods}}
case "{{name}}": 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}} {{#isApiKey}}
{{#isOAuth}}//TODO support oauth{{/isOAuth}} {{#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; break;
{{/authMethods}} {{/authMethods}}
default: default:

View File

@ -37,6 +37,12 @@ namespace {{clientPackage}}
/// <value>The password.</value> /// <value>The password.</value>
public static String Password { get; set; } 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> /// <summary>
/// Gets or sets the API key based on the authentication name. /// Gets or sets the API key based on the authentication name.
/// </summary> /// </summary>

View File

@ -56,16 +56,31 @@ namespace Example
{ {
public void main() 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}}} // Configure HTTP basic authorization: {{{name}}}
Configuration.Default.Username = "YOUR_USERNAME"; 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}}} // Configure API key authorization: {{{name}}}
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // 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}}} // Configure OAuth2 access token for authorization: {{{name}}}
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}} Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
{{/isOAuth}}
{{/authMethods}}
{{/hasAuthMethods}} {{/hasAuthMethods}}
var apiInstance = new {{classname}}(); var apiInstance = new {{classname}}();
@ -123,21 +138,29 @@ No model defined in this package
All endpoints do not require authorization. All endpoints do not require authorization.
{{/authMethods}} {{/authMethods}}
{{#authMethods}} {{#authMethods}}
{{#last}} {{#-last}}
Authentication schemes defined for the API: Authentication schemes defined for the API:
{{/last}} {{/-last}}
{{/authMethods}} {{/authMethods}}
{{#authMethods}} {{#authMethods}}
<a name="{{name}}"></a> <a name="{{name}}"></a>
### {{name}} ### {{name}}
{{#isApiKey}}- **Type**: API key {{#isApiKey}}
- **Type**: API key
- **API key parameter name**: {{keyParamName}} - **API key parameter name**: {{keyParamName}}
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
{{/isApiKey}} {{/isApiKey}}
{{#isBasic}}- **Type**: HTTP basic authentication {{#isBasic}}
{{#isBasicBasic}}
- **Type**: HTTP basic authentication
{{/isBasicBasic}}
{{#isBasicBearer}}
- **Type**: HTTP bearer authentication
{{/isBasicBearer}}
{{/isBasic}} {{/isBasic}}
{{#isOAuth}}- **Type**: OAuth {{#isOAuth}}
- **Type**: OAuth
- **Flow**: {{flow}} - **Flow**: {{flow}}
- **Authorization URL**: {{authorizationUrl}} - **Authorization URL**: {{authorizationUrl}}
- **Scopes**: {{^scopes}}N/A{{/scopes}} - **Scopes**: {{^scopes}}N/A{{/scopes}}

View File

@ -32,18 +32,32 @@ namespace Example
{ {
public void main() public void main()
{ {
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}} {{#hasAuthMethods}}
{{#authMethods}}
{{#isBasic}}
{{#isBasicBasic}}
// Configure HTTP basic authorization: {{{name}}} // Configure HTTP basic authorization: {{{name}}}
Configuration.Default.Username = "YOUR_USERNAME"; 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}}} // Configure API key authorization: {{{name}}}
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // 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}}} // Configure OAuth2 access token for authorization: {{{name}}}
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";{{/isOAuth}}{{/authMethods}} Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
{{/hasAuthMethods}} {{/isOAuth}}
{{/authMethods}}
{{/hasAuthMethods}}
var apiInstance = new {{classname}}(); var apiInstance = new {{classname}}();
{{#allParams}} {{#allParams}}
{{#isPrimitiveType}} {{#isPrimitiveType}}

View File

@ -169,7 +169,7 @@ namespace {{packageName}}.Client
public static String SelectHeaderContentType(String[] contentTypes) public static String SelectHeaderContentType(String[] contentTypes)
{ {
if (contentTypes.Length == 0) if (contentTypes.Length == 0)
return "application/json"; return null;
foreach (var contentType in contentTypes) foreach (var contentType in contentTypes)
{ {

View File

@ -119,9 +119,15 @@ namespace Example
{{#hasAuthMethods}} {{#hasAuthMethods}}
{{#authMethods}} {{#authMethods}}
{{#isBasic}} {{#isBasic}}
{{#isBasicBasic}}
// Configure HTTP basic authorization: {{{name}}} // Configure HTTP basic authorization: {{{name}}}
Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD"; Configuration.Default.Password = "YOUR_PASSWORD";
{{/isBasicBasic}}
{{#isBasicBearer}}
// Configure HTTP bearer authorization: {{{name}}}
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
{{/isBasicBearer}}
{{/isBasic}} {{/isBasic}}
{{#isApiKey}} {{#isApiKey}}
// Configure API key authorization: {{{name}}} // 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}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
{{/isApiKey}} {{/isApiKey}}
{{#isBasic}} {{#isBasic}}
{{#isBasicBasic}}
- **Type**: HTTP basic authentication - **Type**: HTTP basic authentication
{{/isBasicBasic}}
{{#isBasicBearer}}
- **Type**: HTTP bearer authentication
{{/isBasicBearer}}
{{/isBasic}} {{/isBasic}}
{{#isOAuth}} {{#isOAuth}}

View File

@ -278,11 +278,20 @@ namespace {{packageName}}.{{apiPackage}}
{{/isKeyInQuery}} {{/isKeyInQuery}}
{{/isApiKey}} {{/isApiKey}}
{{#isBasic}} {{#isBasic}}
{{#isBasicBasic}}
// http basic authentication required // http basic authentication required
if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
{ {
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + 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}} {{/isBasic}}
{{#isOAuth}} {{#isOAuth}}
// oauth required // oauth required
@ -414,11 +423,20 @@ namespace {{packageName}}.{{apiPackage}}
{{/isKeyInQuery}} {{/isKeyInQuery}}
{{/isApiKey}} {{/isApiKey}}
{{#isBasic}} {{#isBasic}}
{{#isBasicBasic}}
// http basic authentication required // http basic authentication required
if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
{ {
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(this.Configuration.Username + ":" + 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}} {{/isBasic}}
{{#isOAuth}} {{#isOAuth}}
// oauth required // oauth required

View File

@ -39,9 +39,15 @@ namespace Example
{{#hasAuthMethods}} {{#hasAuthMethods}}
{{#authMethods}} {{#authMethods}}
{{#isBasic}} {{#isBasic}}
{{#isBasicBasic}}
// Configure HTTP basic authorization: {{{name}}} // Configure HTTP basic authorization: {{{name}}}
Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD"; Configuration.Default.Password = "YOUR_PASSWORD";
{{/isBasicBasic}}
{{#isBasicBearer}}
// Configure HTTP bearer authorization: {{{name}}}
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
{{/isBasicBearer}}
{{/isBasic}} {{/isBasic}}
{{#isApiKey}} {{#isApiKey}}
// Configure API key authorization: {{{name}}} // Configure API key authorization: {{{name}}}

View File

@ -101,6 +101,31 @@
//Convert elements with "marked" class to markdown //Convert elements with "marked" class to markdown
processMarked(); 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> </script>
<style type="text/css"> <style type="text/css">
{{>fonts}} {{>fonts}}
@ -416,9 +441,14 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var schemaWrapper = {{{jsonSchema}}}; var schemaWrapper = {{{jsonSchema}}};
var schema = schemaWrapper.schema; var schema = findNode('schema',schemaWrapper).schema;
if (!schema) {
schema = schemaWrapper.schema;
}
if (schema.$ref != null) { if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref); schema = defsParser.$refs.get(schema.$ref);
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else { } else {
schemaWrapper.definitions = Object.assign({}, defs); schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) { $RefParser.dereference(schemaWrapper).catch(function(err) {
@ -505,8 +535,7 @@
{{>js_json_stringify_safe}} {{>js_json_stringify_safe}}
{{>js_webfontloader}} {{>js_webfontloader}}
<script> <script>
var schemaWrapper = {}; var schemaWrapper = { "components": { "schemas" : defs}};
schemaWrapper.definitions = Object.assign({}, defs);
defsParser = new $RefParser(); defsParser = new $RefParser();
defsParser.dereference(schemaWrapper).catch(function(err) { defsParser.dereference(schemaWrapper).catch(function(err) {
console.log(err); console.log(err);

View File

@ -4,7 +4,10 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var schemaWrapper = {{{jsonSchema}}}; var schemaWrapper = {{{jsonSchema}}};
var schema = schemaWrapper.schema; var schema = findNode('schema', schemaWrapper).schema;
if (!schema) {
schema = schemaWrapper.schema;
}
if (schema.$ref != null) { if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref); schema = defsParser.$refs.get(schema.$ref);
} else { } else {

View File

@ -42,4 +42,113 @@ CREATE TABLE IF NOT EXISTS {{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{
{{/x-mysqlSchema}} {{/x-mysqlSchema}}
{{/vendorExtensions}} {{/vendorExtensions}}
{{/isArrayModel}}{{/hasVars}}{{/model}}{{/models}} {{/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}}

View File

@ -2,6 +2,7 @@ package {{package}}
import akka.http.scaladsl.server.Directives._ import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route import akka.http.scaladsl.server.Route
import akka.http.scaladsl.model.StatusCodes
{{^pathMatcherPatterns.isEmpty}}import akka.http.scaladsl.server.{PathMatcher, PathMatcher1} {{^pathMatcherPatterns.isEmpty}}import akka.http.scaladsl.server.{PathMatcher, PathMatcher1}
{{/pathMatcherPatterns.isEmpty}} {{/pathMatcherPatterns.isEmpty}}
{{#hasMarshalling}}import akka.http.scaladsl.marshalling.ToEntityMarshaller {{#hasMarshalling}}import akka.http.scaladsl.marshalling.ToEntityMarshaller
@ -63,8 +64,9 @@ object {{classname}}Patterns {
trait {{classname}}Service { trait {{classname}}Service {
{{#operation}} {{#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 = {{#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}}{{code}}{{/vendorExtensions.x-is-default}}, {{#baseType}}response{{baseType}}{{containerType}}{{/baseType}}{{^baseType}}"{{message}}"{{/baseType}})) 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}}
/** /**
{{#responses}} * {{#code}}Code: {{.}}{{/code}}{{#message}}, Message: {{.}}{{/message}}{{#dataType}}, DataType: {{.}}{{/dataType}} {{#responses}} * {{#code}}Code: {{.}}{{/code}}{{#message}}, Message: {{.}}{{/message}}{{#dataType}}, DataType: {{.}}{{/dataType}}

View File

@ -1,4 +1,4 @@
wwwroot/*.js wwwroot/*.js
node_modules node_modules
typings typings
dist dist

View File

@ -0,0 +1 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm

View File

@ -182,7 +182,7 @@ export class Configuration {
} }
export type Json = any; 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 HTTPHeaders = { [key: string]: string };
export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | HTTPQuery }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | HTTPQuery };
export type HTTPBody = Json | FormData | URLSearchParams; export type HTTPBody = Json | FormData | URLSearchParams;

View File

@ -604,6 +604,37 @@ public class DefaultCodegenTest {
Assert.assertEquals(getRequiredVars(childModel), Collections.singletonList("name")); 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 @Test
public void testAllOfSingleRefNoOwnProps() { public void testAllOfSingleRefNoOwnProps() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml");
@ -774,6 +805,19 @@ public class DefaultCodegenTest {
Assert.assertTrue(property.isNullable); 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 @Test
public void testDeprecatedProperty() { public void testDeprecatedProperty() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/property-deplicated.yaml"); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/property-deplicated.yaml");

View File

@ -26,6 +26,17 @@ paths:
$ref: "#/components/schemas/SuperMan" $ref: "#/components/schemas/SuperMan"
components: components:
schemas: 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: SuperMan:
allOf: allOf:
- $ref: '#/components/schemas/Human' - $ref: '#/components/schemas/Human'

View File

@ -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

View File

@ -689,6 +689,7 @@ components:
type: string type: string
password: password:
type: string type: string
pattern: '["A-Z]+-[0-9][0-9]'
phone: phone:
type: string type: string
userStatus: userStatus:

View File

@ -1319,6 +1319,7 @@
<module>samples/client/petstore/java/resteasy</module> <module>samples/client/petstore/java/resteasy</module>
<module>samples/client/petstore/java/google-api-client</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</module>
<module>samples/client/petstore/java/rest-assured-jackson</module>
<module>samples/client/petstore/groovy</module> <module>samples/client/petstore/groovy</module>
<!-- servers --> <!-- servers -->
<module>samples/server/petstore/jaxrs-jersey</module> <module>samples/server/petstore/jaxrs-jersey</module>

View File

@ -112,6 +112,7 @@ Class | Method | HTTP request | Description
<a name="documentation-for-authorization"></a> <a name="documentation-for-authorization"></a>
## Documentation for Authorization ## Documentation for Authorization
Authentication schemes defined for the API:
<a name="api_key"></a> <a name="api_key"></a>
### api_key ### api_key

View File

@ -34,7 +34,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
@ -96,7 +95,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
@ -162,7 +160,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
@ -227,7 +224,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
@ -292,7 +288,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure API key authorization: api_key // Configure API key authorization: api_key
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY"); Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
@ -357,7 +352,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
@ -419,7 +413,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
@ -485,7 +478,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure OAuth2 access token for authorization: petstore_auth // Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

View File

@ -32,7 +32,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new StoreApi(); var apiInstance = new StoreApi();
var orderId = orderId_example; // string | ID of the order that needs to be deleted var orderId = orderId_example; // string | ID of the order that needs to be deleted
@ -93,7 +92,6 @@ namespace Example
{ {
public void main() public void main()
{ {
// Configure API key authorization: api_key // Configure API key authorization: api_key
Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY"); Configuration.Default.ApiKey.Add("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
@ -156,7 +154,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new StoreApi(); var apiInstance = new StoreApi();
var orderId = 789; // long? | ID of pet that needs to be fetched var orderId = 789; // long? | ID of pet that needs to be fetched
@ -216,7 +213,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new StoreApi(); var apiInstance = new StoreApi();
var body = new Order(); // Order | order placed for purchasing the pet var body = new Order(); // Order | order placed for purchasing the pet

View File

@ -36,7 +36,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var body = new User(); // User | Created user object var body = new User(); // User | Created user object
@ -95,7 +94,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var body = new List<User>(); // List<User> | List of user object var body = new List<User>(); // List<User> | List of user object
@ -154,7 +152,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var body = new List<User>(); // List<User> | List of user object var body = new List<User>(); // List<User> | List of user object
@ -215,7 +212,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var username = username_example; // string | The name that needs to be deleted var username = username_example; // string | The name that needs to be deleted
@ -274,7 +270,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. 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() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var username = username_example; // string | The user name for login var username = username_example; // string | The user name for login
var password = password_example; // string | The password for login in clear text var password = password_example; // string | The password for login in clear text
@ -396,7 +390,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
try try
@ -453,7 +446,6 @@ namespace Example
{ {
public void main() public void main()
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var username = username_example; // string | name that need to be deleted var username = username_example; // string | name that need to be deleted
var body = new User(); // User | Updated user object var body = new User(); // User | Updated user object

View File

@ -261,11 +261,9 @@ namespace Org.OpenAPITools.Client
{ {
case "api_key": case "api_key":
headerParams["api_key"] = GetApiKeyWithPrefix("api_key"); headerParams["api_key"] = GetApiKeyWithPrefix("api_key");
break; break;
case "petstore_auth": case "petstore_auth":
headerParams["Authorization"] = "Bearer " + Configuration.AccessToken;
//TODO support oauth
break; break;
default: default:
//TODO show warning about security definition not found //TODO show warning about security definition not found

View File

@ -37,6 +37,12 @@ namespace Org.OpenAPITools.Client
/// <value>The password.</value> /// <value>The password.</value>
public static String Password { get; set; } 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> /// <summary>
/// Gets or sets the API key based on the authentication name. /// Gets or sets the API key based on the authentication name.
/// </summary> /// </summary>

View File

@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Client
public static String SelectHeaderContentType(String[] contentTypes) public static String SelectHeaderContentType(String[] contentTypes)
{ {
if (contentTypes.Length == 0) if (contentTypes.Length == 0)
return "application/json"; return null;
foreach (var contentType in contentTypes) foreach (var contentType in contentTypes)
{ {

View File

@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Client
public static String SelectHeaderContentType(String[] contentTypes) public static String SelectHeaderContentType(String[] contentTypes)
{ {
if (contentTypes.Length == 0) if (contentTypes.Length == 0)
return "application/json"; return null;
foreach (var contentType in contentTypes) foreach (var contentType in contentTypes)
{ {

View 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

View File

@ -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

View File

@ -0,0 +1 @@
4.3.1-SNAPSHOT

View File

@ -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

View 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

File diff suppressed because it is too large Load Diff

View 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"
}

View 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"
)
)

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesAnyType
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesArray
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesBoolean
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,22 @@
# AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapString** | **Map&lt;String, String&gt;** | | [optional]
**mapNumber** | [**Map&lt;String, BigDecimal&gt;**](BigDecimal.md) | | [optional]
**mapInteger** | **Map&lt;String, Integer&gt;** | | [optional]
**mapBoolean** | **Map&lt;String, Boolean&gt;** | | [optional]
**mapArrayInteger** | [**Map&lt;String, List&lt;Integer&gt;&gt;**](List.md) | | [optional]
**mapArrayAnytype** | [**Map&lt;String, List&lt;Object&gt;&gt;**](List.md) | | [optional]
**mapMapString** | [**Map&lt;String, Map&lt;String, String&gt;&gt;**](Map.md) | | [optional]
**mapMapAnytype** | [**Map&lt;String, Map&lt;String, Object&gt;&gt;**](Map.md) | | [optional]
**anytype1** | [**Object**](.md) | | [optional]
**anytype2** | [**Object**](.md) | | [optional]
**anytype3** | [**Object**](.md) | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesInteger
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesNumber
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# AdditionalPropertiesString
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@ -0,0 +1,13 @@
# Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional]

View File

@ -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

View File

@ -0,0 +1,12 @@
# ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayArrayNumber** | [**List&lt;List&lt;BigDecimal&gt;&gt;**](List.md) | | [optional]

View File

@ -0,0 +1,12 @@
# ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayNumber** | [**List&lt;BigDecimal&gt;**](BigDecimal.md) | | [optional]

View File

@ -0,0 +1,14 @@
# ArrayTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayOfString** | **List&lt;String&gt;** | | [optional]
**arrayArrayOfInteger** | [**List&lt;List&lt;Long&gt;&gt;**](List.md) | | [optional]
**arrayArrayOfModel** | [**List&lt;List&lt;ReadOnlyFirst&gt;&gt;**](List.md) | | [optional]

View File

@ -0,0 +1,23 @@
# BigCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | [**KindEnum**](#KindEnum) | | [optional]
## Enum: KindEnum
Name | Value
---- | -----
LIONS | &quot;lions&quot;
TIGERS | &quot;tigers&quot;
LEOPARDS | &quot;leopards&quot;
JAGUARS | &quot;jaguars&quot;

View File

@ -0,0 +1,23 @@
# BigCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**kind** | [**KindEnum**](#KindEnum) | | [optional]
## Enum: KindEnum
Name | Value
---- | -----
LIONS | &quot;lions&quot;
TIGERS | &quot;tigers&quot;
LEOPARDS | &quot;leopards&quot;
JAGUARS | &quot;jaguars&quot;

View File

@ -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]

View File

@ -1,9 +1,12 @@
# StringBooleanMap
# Cat
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**declawed** | **Boolean** | | [optional]

View File

@ -0,0 +1,12 @@
# CatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**declawed** | **Boolean** | | [optional]

View File

@ -0,0 +1,13 @@
# Category
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**name** | **String** | |

View File

@ -0,0 +1,13 @@
# ClassModel
Model for testing model with \"_class\" property
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**propertyClass** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# Client
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client** | **String** | | [optional]

View File

@ -1,9 +1,12 @@
# AnimalFarm
# Dog
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**breed** | **String** | | [optional]

View File

@ -0,0 +1,12 @@
# DogAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breed** | **String** | | [optional]

View File

@ -0,0 +1,31 @@
# EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
**arrayEnum** | [**List&lt;ArrayEnumEnum&gt;**](#List&lt;ArrayEnumEnum&gt;) | | [optional]
## Enum: JustSymbolEnum
Name | Value
---- | -----
GREATER_THAN_OR_EQUAL_TO | &quot;&gt;&#x3D;&quot;
DOLLAR | &quot;$&quot;
## Enum: List&lt;ArrayEnumEnum&gt;
Name | Value
---- | -----
FISH | &quot;fish&quot;
CRAB | &quot;crab&quot;

View File

@ -0,0 +1,15 @@
# EnumClass
## Enum
* `_ABC` (value: `"_abc"`)
* `_EFG` (value: `"-efg"`)
* `_XYZ_` (value: `"(xyz)"`)

View File

@ -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 | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
## Enum: EnumStringRequiredEnum
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;
EMPTY | &quot;&quot;
## 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

View File

@ -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 \&quot;client\&quot; 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 &#x60;File&#x60;.
### 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 \&quot;client\&quot; model
To test \&quot;client\&quot; 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&lt;String&gt;**](String.md)| Header parameter enum test (string array) | [optional] [default to new ArrayList&lt;&gt;()] [enum: >, $]
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**List&lt;String&gt;**](String.md)| Query parameter enum test (string array) | [optional] [default to new ArrayList&lt;&gt;()] [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&lt;String&gt;**](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&lt;String, String&gt;**](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&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**ioutil** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**http** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**url** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
**context** | [**List&lt;String&gt;**](String.md)| | [default to new ArrayList&lt;&gt;()]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined

View File

@ -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

View File

@ -0,0 +1,13 @@
# FileSchemaTestClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**java.io.File**](java.io.File.md) | | [optional]
**files** | [**List&lt;java.io.File&gt;**](java.io.File.md) | | [optional]

View File

@ -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]

View File

@ -0,0 +1,13 @@
# HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional] [readonly]
**foo** | **String** | | [optional] [readonly]

View File

@ -0,0 +1,24 @@
# MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapMapOfString** | [**Map&lt;String, Map&lt;String, String&gt;&gt;**](Map.md) | | [optional]
**mapOfEnumString** | [**Map&lt;String, InnerEnum&gt;**](#Map&lt;String, InnerEnum&gt;) | | [optional]
**directMap** | **Map&lt;String, Boolean&gt;** | | [optional]
**indirectMap** | **Map&lt;String, Boolean&gt;** | | [optional]
## Enum: Map&lt;String, InnerEnum&gt;
Name | Value
---- | -----
UPPER | &quot;UPPER&quot;
LOWER | &quot;lower&quot;

View File

@ -0,0 +1,14 @@
# MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | [**UUID**](UUID.md) | | [optional]
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
**map** | [**Map&lt;String, Animal&gt;**](Animal.md) | | [optional]

View File

@ -0,0 +1,14 @@
# Model200Response
Model for testing model name starting with number
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | | [optional]
**propertyClass** | **String** | | [optional]

View File

@ -0,0 +1,14 @@
# ModelApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Integer** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

View File

@ -0,0 +1,13 @@
# ModelReturn
Model for testing reserved words
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_return** | **Integer** | | [optional]

View File

@ -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]

View File

@ -0,0 +1,12 @@
# NumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]

View File

@ -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 | &quot;placed&quot;
APPROVED | &quot;approved&quot;
DELIVERED | &quot;delivered&quot;

View File

@ -0,0 +1,14 @@
# OuterComposite
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
**myString** | **String** | | [optional]
**myBoolean** | **Boolean** | | [optional]

View File

@ -0,0 +1,15 @@
# OuterEnum
## Enum
* `PLACED` (value: `"placed"`)
* `APPROVED` (value: `"approved"`)
* `DELIVERED` (value: `"delivered"`)

View File

@ -0,0 +1,27 @@
# Pet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **List&lt;String&gt;** | |
**tags** | [**List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
## Enum: StatusEnum
Name | Value
---- | -----
AVAILABLE | &quot;available&quot;
PENDING | &quot;pending&quot;
SOLD | &quot;sold&quot;

Some files were not shown because too many files have changed in this diff Show More