Prepare 3.1.0-SNAPSHOT (#408)

This commit is contained in:
Jérémie Bresson 2018-06-28 06:52:40 +02:00 committed by GitHub
commit 9b909df543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
538 changed files with 6185 additions and 595 deletions

View File

@ -9,7 +9,7 @@
<artifactId>openapi-generator-project</artifactId>
<packaging>pom</packaging>
<name>openapi-generator-project</name>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<url>https://github.com/openapi-tools/openapi-generator</url>
<scm>
<connection>scm:git:git@github.com:openapi-tools/openapi-generator.git</connection>

View File

@ -10,7 +10,7 @@
<artifactId>openapi-generator-project</artifactId>
<packaging>pom</packaging>
<name>openapi-generator-project</name>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<url>https://github.com/openapitools/openapi-generator</url>
<scm>
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>

View File

@ -10,7 +10,7 @@
<artifactId>openapi-generator-project</artifactId>
<packaging>pom</packaging>
<name>openapi-generator-project</name>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<url>https://github.com/openapitools/openapi-generator</url>
<scm>
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>

View File

@ -9,7 +9,7 @@
<artifactId>openapi-generator-project</artifactId>
<packaging>pom</packaging>
<name>openapi-generator-project</name>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<url>https://github.com/openapitools/openapi-generator</url>
<scm>
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>

View File

@ -2,16 +2,11 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.0.3`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.1.0`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[`3.1.x`](https://github.com/OpenAPITools/openapi-generator/tree/3.1.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/3.1.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/3.1.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=3.1.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=3.1.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[`4.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.0.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/4.0.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/4.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=4.0.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator)
@ -87,8 +82,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
OpenAPI Generator Version | Release Date | OpenAPI Spec compatibility | Notes
---------------------------- | ------------ | -------------------------- | -----
4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes (no fallback)
3.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks)
3.0.3 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.0.3/)| TBD | 1.0, 1.1, 1.2,
3.1.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks)
[3.0.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.3) | 27.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
[3.0.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.2) | 18.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
[3.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.1) | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
[3.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.0) | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes
@ -147,12 +142,12 @@ JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generato
For **Mac/Linux** users:
```sh
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.2/openapi-generator-cli-3.0.2.jar -O openapi-generator-cli.jar
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.3/openapi-generator-cli-3.0.3.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.2/openapi-generator-cli-3.0.2.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.3/openapi-generator-cli-3.0.3.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.

View File

@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -34,7 +34,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.2"
classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.3"
}
}

View File

@ -1,4 +1,4 @@
openApiGeneratorVersion=3.0.3
openApiGeneratorVersion=3.1.0-SNAPSHOT
# BEGIN placeholders
# these are just placeholders to allow contributors to build directly

View File

@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -16,5 +16,5 @@ gradle buildGoSdk
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
```bash
gradle -PopenApiGeneratorVersion=3.0.2 openApiValidate
gradle -PopenApiGeneratorVersion=3.0.3 openApiValidate
```

View File

@ -11,7 +11,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
<executions>
<execution>
<goals>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>openapi-generator-maven-plugin</artifactId>

View File

@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine
WORKDIR /generator
COPY target/openapi-generator-online-3.0.3.jar /generator/openapi-generator-online.jar
COPY target/openapi-generator-online-3.1.0-SNAPSHOT.jar /generator/openapi-generator-online.jar
ENV GENERATOR_HOST=http://localhost

View File

@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>openapi-generator-online</artifactId>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -44,6 +44,7 @@ public class CodegenModel {
public String defaultValue;
public String arrayModelType;
public boolean isAlias; // Is this effectively an alias of another simple type
public boolean isString, isInteger;
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
public List<CodegenProperty> requiredVars = new ArrayList<CodegenProperty>(); // a list of required properties
public List<CodegenProperty> optionalVars = new ArrayList<CodegenProperty>(); // a list of optional properties

View File

@ -250,11 +250,11 @@ public class DefaultCodegen implements CodegenConfig {
if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) {
Map<String, Object> allowableValues = cm.allowableValues;
List<Object> values = (List<Object>) allowableValues.get("values");
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
List<Map<String, Object>> enumVars = new ArrayList<Map<String, Object>>();
String commonPrefix = findCommonPrefixOfVars(values);
int truncateIdx = commonPrefix.length();
for (Object value : values) {
Map<String, String> enumVar = new HashMap<String, String>();
Map<String, Object> enumVar = new HashMap<String, Object>();
String enumName;
if (truncateIdx == 0) {
enumName = value.toString();
@ -266,6 +266,7 @@ public class DefaultCodegen implements CodegenConfig {
}
enumVar.put("name", toEnumVarName(enumName, cm.dataType));
enumVar.put("value", toEnumValue(value.toString(), cm.dataType));
enumVar.put("isString", isDataTypeString(cm.dataType));
enumVars.add(enumVar);
}
cm.allowableValues.put("enumVars", enumVars);
@ -1167,7 +1168,7 @@ public class DefaultCodegen implements CodegenConfig {
// TODO better logic to handle compose schema
if (schema instanceof ComposedSchema) { // composed schema
ComposedSchema cs = (ComposedSchema) schema;
if(cs.getAllOf() != null) {
if (cs.getAllOf() != null) {
for (Schema s : cs.getAllOf()) {
if (s != null) {
// using the first schema defined in allOf
@ -1383,6 +1384,9 @@ public class DefaultCodegen implements CodegenConfig {
typeAliases = getAllAliases(allDefinitions);
}
// unalias schema
schema = ModelUtils.unaliasSchema(allDefinitions, schema);
CodegenModel m = CodegenModelFactory.newInstance(CodegenModelType.MODEL);
if (reservedWords.contains(name)) {
@ -1508,9 +1512,8 @@ public class DefaultCodegen implements CodegenConfig {
addProperties(allProperties, allRequired, child, allDefinitions);
}
}
addVars(m, properties, required, allProperties, allRequired);
// TODO
//} else if (schema instanceof RefModel) {
addVars(m, unaliasPropertySchema(allDefinitions, properties), required, allProperties, allRequired);
} else {
m.dataType = getSchemaType(schema);
if (schema.getEnum() != null && !schema.getEnum().isEmpty()) {
@ -1523,7 +1526,16 @@ public class DefaultCodegen implements CodegenConfig {
addAdditionPropertiesToCodeGenModel(m, schema);
m.isMapModel = true;
}
addVars(m, schema.getProperties(), schema.getRequired());
if (ModelUtils.isIntegerSchema(schema)) { // integer type
if (!ModelUtils.isLongSchema(schema)) { // long type is not integer
m.isInteger = Boolean.TRUE;
}
}
if (ModelUtils.isStringSchema(schema)){
m.isString = Boolean.TRUE;
}
addVars(m, unaliasPropertySchema(allDefinitions, schema.getProperties()), schema.getRequired());
}
if (m.vars != null) {
@ -1592,7 +1604,6 @@ public class DefaultCodegen implements CodegenConfig {
return null;
}
LOGGER.debug("debugging fromProperty for " + name + " : " + p);
CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
property.name = toVarName(name);
property.baseName = name;
@ -1833,7 +1844,6 @@ public class DefaultCodegen implements CodegenConfig {
// property.baseType = getSimpleRef(p.get$ref());
//}
// --END of revision
setNonArrayMapProperty(property, type);
}
@ -3048,6 +3058,24 @@ public class DefaultCodegen implements CodegenConfig {
}
}
/**
* Loop through propertiies and unalias the reference if $ref (reference) is defined
*
* @param allSchemas all schemas defined in the spec
* @param properties model properties (schemas)
* @return model properties with direct reference to schemas
*/
private Map<String, Schema> unaliasPropertySchema(Map<String, Schema> allSchemas, Map<String, Schema> properties) {
if (properties != null) {
for (String key : properties.keySet()) {
properties.put(key, ModelUtils.unaliasSchema(allSchemas, properties.get(key)));
}
}
return properties;
}
private void addVars(CodegenModel model, Map<String, Schema> properties, List<String> required) {
addVars(model, properties, required, null, null);
}
@ -3161,9 +3189,11 @@ public class DefaultCodegen implements CodegenConfig {
String oasName = entry.getKey();
Schema schema = entry.getValue();
String schemaType = getPrimitiveType(schema);
if (schemaType != null && !schemaType.equals("object") && !schemaType.equals("array") && schema.getEnum() == null) {
if (schemaType != null && !schemaType.equals("object") && !schemaType.equals("array")
&& schema.getEnum() == null && !ModelUtils.isMapSchema(schema)) {
aliases.put(oasName, schemaType);
}
}
return aliases;
@ -3659,11 +3689,11 @@ public class DefaultCodegen implements CodegenConfig {
}
// put "enumVars" map into `allowableValues", including `name` and `value`
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
List<Map<String, Object>> enumVars = new ArrayList<>();
String commonPrefix = findCommonPrefixOfVars(values);
int truncateIdx = commonPrefix.length();
for (Object value : values) {
Map<String, String> enumVar = new HashMap<String, String>();
Map<String, Object> enumVar = new HashMap<>();
String enumName;
if (truncateIdx == 0) {
enumName = value.toString();
@ -3673,8 +3703,11 @@ public class DefaultCodegen implements CodegenConfig {
enumName = value.toString();
}
}
enumVar.put("name", toEnumVarName(enumName, var.dataType));
enumVar.put("value", toEnumValue(value.toString(), var.dataType));
final String dataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType;
enumVar.put("name", toEnumVarName(enumName, dataType));
enumVar.put("value", toEnumValue(value.toString(), dataType));
enumVar.put("isString", isDataTypeString(dataType));
enumVars.add(enumVar);
}
allowableValues.put("enumVars", enumVars);
@ -3682,9 +3715,9 @@ public class DefaultCodegen implements CodegenConfig {
// handle default value for enum, e.g. available => StatusEnum.AVAILABLE
if (var.defaultValue != null) {
String enumName = null;
for (Map<String, String> enumVar : enumVars) {
for (Map<String, Object> enumVar : enumVars) {
if (toEnumValue(var.defaultValue, var.dataType).equals(enumVar.get("value"))) {
enumName = enumVar.get("name");
enumName = (String) enumVar.get("name");
break;
}
}
@ -3897,14 +3930,14 @@ public class DefaultCodegen implements CodegenConfig {
}
Set<String> existingMediaTypes = new HashSet<>();
for (Map<String, String> mediaType: codegenOperation.produces) {
for (Map<String, String> mediaType : codegenOperation.produces) {
existingMediaTypes.add(mediaType.get("mediaType"));
}
int count = 0;
for (String key : produces) {
// escape quotation to avoid code injection, "*/*" is a special case, do nothing
String encodedKey = "*/*".equals(key)? key : escapeText(escapeQuotationMark(key));
String encodedKey = "*/*".equals(key) ? key : escapeText(escapeQuotationMark(key));
//Only unique media types should be added to "produces"
if (!existingMediaTypes.contains(encodedKey)) {
Map<String, String> mediaType = new HashMap<String, String>();
@ -3926,7 +3959,7 @@ public class DefaultCodegen implements CodegenConfig {
/**
* returns the list of MIME types the APIs can produce
*
* @param openAPI current specification instance
* @param openAPI current specification instance
* @param operation Operation
* @return a set of MIME types
*/
@ -4025,10 +4058,9 @@ public class DefaultCodegen implements CodegenConfig {
codegenParameter.isListContainer = true;
codegenParameter.description = s.getDescription();
codegenParameter.dataType = getTypeDeclaration(s);
if (codegenParameter.baseType != null && codegenParameter.enumName != null){
if (codegenParameter.baseType != null && codegenParameter.enumName != null) {
codegenParameter.datatypeWithEnum = codegenParameter.dataType.replace(codegenParameter.baseType, codegenParameter.enumName);
}
else {
} else {
LOGGER.warn("Could not compute datatypeWithEnum from " + codegenParameter.baseType + ", " + codegenParameter.enumName);
}
//TODO fix collectformat for form parameters
@ -4339,9 +4371,12 @@ public class DefaultCodegen implements CodegenConfig {
public void generateYAMLSpecFile(Map<String, Object> objs) {
OpenAPI openAPI = (OpenAPI) objs.get("openAPI");
String yaml = SerializerUtils.toYamlString(openAPI);
if(yaml != null) {
if (yaml != null) {
objs.put("openapi-yaml", yaml);
}
}
public boolean isDataTypeString(String dataType) {
return "String".equals(dataType);
}
}

View File

@ -557,4 +557,26 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
boolean imports = !type.startsWith("kotlin.") && !type.startsWith("java.") && !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type);
return imports;
}
@Override
public String toEnumValue(String value, String datatype) {
if ("kotlin.Int".equals(datatype) || "kotlin.Long".equals(datatype)) {
return value;
} else if ("kotlin.Double".equals(datatype)) {
if (value.contains(".")) {
return value;
} else {
return value + ".0"; // Float and double must have .0
}
} else if ("kotlin.Float".equals(datatype)) {
return value + "f";
} else {
return "\"" + escapeText(value) + "\"";
}
}
@Override
public boolean isDataTypeString(final String dataType) {
return "String".equals(dataType) || "kotlin.String".equals(dataType);
}
}

View File

@ -90,15 +90,16 @@ public class ModelUtils {
/**
* Return the list of all schemas in the 'components/schemas' section used in the openAPI specification
*
* @param openAPI specification
* @return schemas a list of used schemas
*/
public static List<String> getAllUsedSchemas(OpenAPI openAPI) {
List<String> allUsedSchemas = new ArrayList<String>();
visitOpenAPI(openAPI, (s, t) -> {
if(s.get$ref() != null) {
if (s.get$ref() != null) {
String ref = getSimpleRef(s.get$ref());
if(!allUsedSchemas.contains(ref)) {
if (!allUsedSchemas.contains(ref)) {
allUsedSchemas.add(ref);
}
}
@ -108,6 +109,7 @@ public class ModelUtils {
/**
* Return the list of unused schemas in the 'components/schemas' section of an openAPI specification
*
* @param openAPI specification
* @return schemas a list of unused schemas
*/
@ -118,7 +120,7 @@ public class ModelUtils {
unusedSchemas.addAll(schemas.keySet());
visitOpenAPI(openAPI, (s, t) -> {
if(s.get$ref() != null) {
if (s.get$ref() != null) {
unusedSchemas.remove(getSimpleRef(s.get$ref()));
}
});
@ -127,6 +129,7 @@ public class ModelUtils {
/**
* Return the list of schemas in the 'components/schemas' used only in a 'application/x-www-form-urlencoded' or 'multipart/form-data' mime time
*
* @param openAPI specification
* @return schemas a list of schemas
*/
@ -135,7 +138,7 @@ public class ModelUtils {
List<String> schemasUsedInOtherCases = new ArrayList<String>();
visitOpenAPI(openAPI, (s, t) -> {
if(s.get$ref() != null) {
if (s.get$ref() != null) {
String ref = getSimpleRef(s.get$ref());
if ("application/x-www-form-urlencoded".equalsIgnoreCase(t) ||
"multipart/form-data".equalsIgnoreCase(t)) {
@ -167,7 +170,7 @@ public class ModelUtils {
if (allOperations != null) {
for (Operation operation : allOperations) {
//Params:
if(operation.getParameters() != null) {
if (operation.getParameters() != null) {
for (Parameter p : operation.getParameters()) {
Parameter parameter = getReferencedParameter(openAPI, p);
if (parameter.getSchema() != null) {
@ -187,7 +190,7 @@ public class ModelUtils {
}
//Responses:
if(operation.getResponses() != null) {
if (operation.getResponses() != null) {
for (ApiResponse r : operation.getResponses().values()) {
ApiResponse apiResponse = getReferencedApiResponse(openAPI, r);
if (apiResponse != null && apiResponse.getContent() != null) {
@ -207,51 +210,51 @@ public class ModelUtils {
private static void visitSchema(OpenAPI openAPI, Schema schema, String mimeType, List<String> visitedSchemas, OpenAPISchemaVisitor visitor) {
visitor.visit(schema, mimeType);
if(schema.get$ref() != null) {
if (schema.get$ref() != null) {
String ref = getSimpleRef(schema.get$ref());
if(!visitedSchemas.contains(ref)) {
if (!visitedSchemas.contains(ref)) {
visitedSchemas.add(ref);
Schema referencedSchema = getSchemas(openAPI).get(ref);
if(referencedSchema != null) {
if (referencedSchema != null) {
visitSchema(openAPI, referencedSchema, mimeType, visitedSchemas, visitor);
}
}
}
if(schema instanceof ComposedSchema) {
if (schema instanceof ComposedSchema) {
List<Schema> oneOf = ((ComposedSchema) schema).getOneOf();
if(oneOf != null) {
if (oneOf != null) {
for (Schema s : oneOf) {
visitSchema(openAPI, s, mimeType, visitedSchemas, visitor);
}
}
List<Schema> allOf = ((ComposedSchema) schema).getAllOf();
if(allOf != null) {
if (allOf != null) {
for (Schema s : allOf) {
visitSchema(openAPI, s, mimeType, visitedSchemas, visitor);
}
}
List<Schema> anyOf = ((ComposedSchema) schema).getAnyOf();
if(anyOf != null) {
if (anyOf != null) {
for (Schema s : anyOf) {
visitSchema(openAPI, s, mimeType, visitedSchemas, visitor);
}
}
} else if(schema instanceof ArraySchema) {
} else if (schema instanceof ArraySchema) {
Schema itemsSchema = ((ArraySchema) schema).getItems();
if(itemsSchema != null) {
if (itemsSchema != null) {
visitSchema(openAPI, itemsSchema, mimeType, visitedSchemas, visitor);
}
} else if(isMapSchema(schema)) {
} else if (isMapSchema(schema)) {
Object additionalProperties = schema.getAdditionalProperties();
if(additionalProperties instanceof Schema) {
if (additionalProperties instanceof Schema) {
visitSchema(openAPI, (Schema) additionalProperties, mimeType, visitedSchemas, visitor);
}
}
if(schema.getNot() != null) {
if (schema.getNot() != null) {
visitSchema(openAPI, schema.getNot(), mimeType, visitedSchemas, visitor);
}
Map<String, Schema> properties = schema.getProperties();
if(properties != null) {
if (properties != null) {
for (Schema property : properties.values()) {
visitSchema(openAPI, property, mimeType, visitedSchemas, visitor);
}
@ -269,7 +272,7 @@ public class ModelUtils {
ref = ref.substring(ref.lastIndexOf("/") + 1);
} else if (ref.startsWith("#/definitions/")) {
ref = ref.substring(ref.lastIndexOf("/") + 1);
} else {
} else {
LOGGER.warn("Failed to get the schema name: {}", ref);
return null;
}
@ -478,15 +481,16 @@ public class ModelUtils {
/**
* If a Schema contains a reference to an other Schema with '$ref', returns the referenced Schema if it is found or the actual Schema in the other cases.
*
* @param openAPI specification being checked
* @param schema potentially containing a '$ref'
* @param schema potentially containing a '$ref'
* @return schema without '$ref'
*/
public static Schema getReferencedSchema(OpenAPI openAPI, Schema schema) {
if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) {
String name = getSimpleRef(schema.get$ref());
Schema referencedSchema = getSchema(openAPI, name);
if(referencedSchema != null) {
if (referencedSchema != null) {
return referencedSchema;
}
}
@ -510,7 +514,8 @@ public class ModelUtils {
/**
* If a RequestBody contains a reference to an other RequestBody with '$ref', returns the referenced RequestBody if it is found or the actual RequestBody in the other cases.
* @param openAPI specification being checked
*
* @param openAPI specification being checked
* @param requestBody potentially containing a '$ref'
* @return requestBody without '$ref'
*/
@ -518,7 +523,7 @@ public class ModelUtils {
if (requestBody != null && StringUtils.isNotEmpty(requestBody.get$ref())) {
String name = getSimpleRef(requestBody.get$ref());
RequestBody referencedRequestBody = getRequestBody(openAPI, name);
if(referencedRequestBody != null) {
if (referencedRequestBody != null) {
return referencedRequestBody;
}
}
@ -538,7 +543,8 @@ public class ModelUtils {
/**
* If a ApiResponse contains a reference to an other ApiResponse with '$ref', returns the referenced ApiResponse if it is found or the actual ApiResponse in the other cases.
* @param openAPI specification being checked
*
* @param openAPI specification being checked
* @param apiResponse potentially containing a '$ref'
* @return apiResponse without '$ref'
*/
@ -546,7 +552,7 @@ public class ModelUtils {
if (apiResponse != null && StringUtils.isNotEmpty(apiResponse.get$ref())) {
String name = getSimpleRef(apiResponse.get$ref());
ApiResponse referencedApiResponse = getApiResponse(openAPI, name);
if(referencedApiResponse != null) {
if (referencedApiResponse != null) {
return referencedApiResponse;
}
}
@ -566,7 +572,8 @@ public class ModelUtils {
/**
* If a Parameter contains a reference to an other Parameter with '$ref', returns the referenced Parameter if it is found or the actual Parameter in the other cases.
* @param openAPI specification being checked
*
* @param openAPI specification being checked
* @param parameter potentially containing a '$ref'
* @return parameter without '$ref'
*/
@ -574,7 +581,7 @@ public class ModelUtils {
if (parameter != null && StringUtils.isNotEmpty(parameter.get$ref())) {
String name = getSimpleRef(parameter.get$ref());
Parameter referencedParameter = getParameter(openAPI, name);
if(referencedParameter != null) {
if (referencedParameter != null) {
return referencedParameter;
}
}
@ -594,6 +601,7 @@ public class ModelUtils {
/**
* Return the first defined Schema for a RequestBody
*
* @param requestBody request body of the operation
* @return firstSchema
*/
@ -603,6 +611,7 @@ public class ModelUtils {
/**
* Return the first defined Schema for a ApiResponse
*
* @param response api response of the operation
* @return firstSchema
*/
@ -614,10 +623,38 @@ public class ModelUtils {
if (content == null || content.isEmpty()) {
return null;
}
if(content.size() > 1) {
if (content.size() > 1) {
LOGGER.warn("Multiple schemas found, returning only the first one");
}
MediaType mediaType = content.values().iterator().next();
return mediaType.getSchema();
}
/**
* Get the actual schema from aliases. If the provided schema is not an alias, the schema itself will be returned.
*
* @param allSchemas all schemas
* @param schema schema (alias or direct reference)
* @return actual schema
*/
public static Schema unaliasSchema(Map<String, Schema> allSchemas, Schema schema) {
if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) {
Schema ref = allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()));
if (ref == null) {
LOGGER.warn("{} is not defined", schema.get$ref());
return schema;
} else if (isObjectSchema(ref)) { // model
return schema;
} else if (isStringSchema(ref) && (ref.getEnum() != null && !ref.getEnum().isEmpty())) {
// top-level enum class
return schema;
} else if (isMapSchema(ref) || isArraySchema(ref)) { // map/array def should be created as models
return schema;
} else {
return unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())));
}
}
return schema;
}
}

View File

@ -3,7 +3,7 @@
public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
{{#allowableValues}}
{{#enumVars}}@XmlEnumValue({{{value}}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
{{#enumVars}}@XmlEnumValue({{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
{{/allowableValues}}
@ -13,7 +13,7 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
value = v;
}
public String value() {
public {{dataType}} value() {
return value;
}

View File

@ -6,6 +6,6 @@ import com.squareup.moshi.Json
*/
enum class {{classname}}(val value: {{dataType}}){
{{#allowableValues}}{{#enumVars}}
@Json(name = {{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
@Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
{{/enumVars}}{{/allowableValues}}
}

View File

@ -33,8 +33,10 @@ import org.testng.Assert;
import org.testng.annotations.Test;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -202,7 +204,7 @@ public class DefaultCodegenTest {
Assert.assertEquals(co.produces.size(), 1);
Assert.assertEquals(co.produces.get(0).get("mediaType"), "application/json");
}
@Test
public void testGetSchemaTypeWithComposedSchemaWithOneOf() {
final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/composed-oneof.yaml", null, new ParseOptions()).getOpenAPI();
@ -214,4 +216,32 @@ public class DefaultCodegenTest {
Assert.assertNotNull(type);
}
@Test
public void updateCodegenPropertyEnum() {
final DefaultCodegen codegen = new DefaultCodegen();
CodegenProperty array = codegenPropertyWithArrayOfIntegerValues();
codegen.updateCodegenPropertyEnum(array);
List<Map<String, Object>> enumVars = (List<Map<String, Object>>) array.getItems().getAllowableValues().get("enumVars");
Assert.assertNotNull(enumVars);
Map<String, Object> testedEnumVar = enumVars.get(0);
Assert.assertNotNull(testedEnumVar);
Assert.assertEquals(testedEnumVar.getOrDefault("name", ""),"_1");
Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "\"1\"");
Assert.assertEquals(testedEnumVar.getOrDefault("isString", ""), false);
}
private CodegenProperty codegenPropertyWithArrayOfIntegerValues() {
CodegenProperty array = new CodegenProperty();
final CodegenProperty items = new CodegenProperty();
final HashMap<String, Object> allowableValues = new HashMap<>();
allowableValues.put("values", Collections.singletonList(1));
items.setAllowableValues(allowableValues);
items.dataType = "Integer";
array.setItems(items);
array.dataType = "Array";
return array;
}
}

View File

@ -136,6 +136,15 @@ public class AbstractJavaCodegenTest {
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.invoker.oooooo");
}
@Test
public void toEnumValue(){
final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen();
Assert.assertEquals(codegen.toEnumValue("1", "Integer"), "1");
Assert.assertEquals(codegen.toEnumValue("42", "Double"), "42");
Assert.assertEquals(codegen.toEnumValue("1337", "Long"), "1337l");
Assert.assertEquals(codegen.toEnumValue("3.14", "Float"), "3.14f");
}
private static class P_AbstractJavaCodegen extends AbstractJavaCodegen {
@Override
public CodegenType getTag() {

View File

@ -34,12 +34,7 @@ import io.swagger.v3.oas.models.parameters.RequestBody;
import io.swagger.v3.parser.core.models.ParseOptions;
import io.swagger.v3.parser.util.SchemaTypeUtil;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.CodegenModel;
import org.openapitools.codegen.CodegenModelFactory;
import org.openapitools.codegen.CodegenModelType;
import org.openapitools.codegen.CodegenOperation;
import org.openapitools.codegen.CodegenParameter;
import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.JavaClientCodegen;
import org.openapitools.codegen.utils.ModelUtils;
import org.testng.Assert;
@ -309,7 +304,7 @@ public class JavaClientCodegenTest {
Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.mmmmm");
Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm");
}
@Test
public void testGetSchemaTypeWithComposedSchemaWithAllOf() {
final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/2_0/composed-allof.yaml", null, new ParseOptions()).getOpenAPI();
@ -321,6 +316,34 @@ public class JavaClientCodegenTest {
Assert.assertEquals(co.allParams.get(0).baseType, "MessageEventCoreWithTimeListEntries");
}
@Test
public void updateCodegenPropertyEnum() {
final JavaClientCodegen codegen = new JavaClientCodegen();
CodegenProperty array = codegenPropertyWithArrayOfIntegerValues();
codegen.updateCodegenPropertyEnum(array);
List<Map<String, String>> enumVars = (List<Map<String, String>>) array.getItems().getAllowableValues().get("enumVars");
Assert.assertNotNull(enumVars);
Map<String, String> testedEnumVar = enumVars.get(0);
Assert.assertNotNull(testedEnumVar);
Assert.assertEquals(testedEnumVar.getOrDefault("name", ""),"NUMBER_1");
Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "1");
}
private CodegenProperty codegenPropertyWithArrayOfIntegerValues() {
CodegenProperty array = new CodegenProperty();
final CodegenProperty items = new CodegenProperty();
final HashMap<String, Object> allowableValues = new HashMap<>();
allowableValues.put("values", Collections.singletonList(1));
items.setAllowableValues(allowableValues);
items.dataType = "Integer";
array.setItems(items);
array.dataType = "Array";
array.mostInnerItems = items;
return array;
}
private CodegenParameter createPathParam(String name) {
CodegenParameter codegenParameter = createStringParam(name);
codegenParameter.isPathParam = true;

View File

@ -943,11 +943,11 @@ public class JavaModelTest {
Assert.assertTrue(cp.isNotContainer);
Assert.assertFalse(cp.isLong);
Assert.assertFalse(cp.isInteger);
// Assert.assertTrue(cp.isString); //TODO: issue swagger-api/swagger-codegen#8001
Assert.assertTrue(cp.isString);
Assert.assertEquals(cp.getter, "getSomePropertyWithMinMaxAndPattern");
// Assert.assertEquals(cp.minLength, Integer.valueOf(3)); //TODO: issue swagger-api/swagger-codegen#8001
// Assert.assertEquals(cp.maxLength, Integer.valueOf(10)); //TODO: issue swagger-api/swagger-codegen#8001
// Assert.assertEquals(cp.pattern, "^[A-Z]+$"); //TODO: issue swagger-api/swagger-codegen#8001
Assert.assertEquals(cp.minLength, Integer.valueOf(3));
Assert.assertEquals(cp.maxLength, Integer.valueOf(10));
Assert.assertEquals(cp.pattern, "^[A-Z]+$");
}
@Test(description = "convert an array schema")

View File

@ -6,6 +6,9 @@ import org.testng.Assert;
import org.testng.annotations.Test;
import static org.openapitools.codegen.CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.*;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
public class AbstractKotlinCodegenTest {
@ -14,41 +17,51 @@ public class AbstractKotlinCodegenTest {
@Test
public void camlCaseEnumConverter() {
codegen.setEnumPropertyNaming(camelCase.name());
Assert.assertEquals(codegen.toEnumVarName("long Name", null), "longName");
Assert.assertEquals(codegen.toEnumVarName("1long Name", null), "_1longName");
Assert.assertEquals(codegen.toEnumVarName("not1long Name", null), "not1longName");
assertEquals(codegen.toEnumVarName("long Name", null), "longName");
assertEquals(codegen.toEnumVarName("1long Name", null), "_1longName");
assertEquals(codegen.toEnumVarName("not1long Name", null), "not1longName");
}
@Test
public void uppercasEnumConverter() {
codegen.setEnumPropertyNaming(UPPERCASE.name());
Assert.assertEquals(codegen.toEnumVarName("long Name", null), "LONG_NAME");
Assert.assertEquals(codegen.toEnumVarName("1long Name", null), "_1LONG_NAME");
Assert.assertEquals(codegen.toEnumVarName("not1long Name", null), "NOT1LONG_NAME");
assertEquals(codegen.toEnumVarName("long Name", null), "LONG_NAME");
assertEquals(codegen.toEnumVarName("1long Name", null), "_1LONG_NAME");
assertEquals(codegen.toEnumVarName("not1long Name", null), "NOT1LONG_NAME");
}
@Test
public void snake_caseEnumConverter() {
codegen.setEnumPropertyNaming(snake_case.name());
Assert.assertEquals(codegen.toEnumVarName("long Name", null), "long_name");
Assert.assertEquals(codegen.toEnumVarName("1long Name", null), "_1long_name");
Assert.assertEquals(codegen.toEnumVarName("not1long Name", null), "not1long_name");
assertEquals(codegen.toEnumVarName("long Name", null), "long_name");
assertEquals(codegen.toEnumVarName("1long Name", null), "_1long_name");
assertEquals(codegen.toEnumVarName("not1long Name", null), "not1long_name");
}
@Test
public void originalEnumConverter() {
codegen.setEnumPropertyNaming(original.name());
Assert.assertEquals(codegen.toEnumVarName("long Name", null), "long_Name");
Assert.assertEquals(codegen.toEnumVarName("1long Name", null), "_1long_Name");
Assert.assertEquals(codegen.toEnumVarName("not1long Name", null), "not1long_Name");
assertEquals(codegen.toEnumVarName("long Name", null), "long_Name");
assertEquals(codegen.toEnumVarName("1long Name", null), "_1long_Name");
assertEquals(codegen.toEnumVarName("not1long Name", null), "not1long_Name");
}
@Test
public void pascalCaseEnumConverter() {
codegen.setEnumPropertyNaming(PascalCase.name());
Assert.assertEquals(codegen.toEnumVarName("long Name", null), "LongName");
Assert.assertEquals(codegen.toEnumVarName("1long Name", null), "_1longName");
Assert.assertEquals(codegen.toEnumVarName("not1long Name", null), "Not1longName");
assertEquals(codegen.toEnumVarName("long Name", null), "LongName");
assertEquals(codegen.toEnumVarName("1long Name", null), "_1longName");
assertEquals(codegen.toEnumVarName("not1long Name", null), "Not1longName");
}
@Test
public void toEnumValue(){
assertEquals(codegen.toEnumValue("1", "kotlin.Int"), "1");
assertEquals(codegen.toEnumValue("1", "kotlin.Double"), "1.0");
assertEquals(codegen.toEnumValue("1.3", "kotlin.Double"), "1.3");
assertEquals(codegen.toEnumValue("1337", "kotlin.Long"), "1337");
assertEquals(codegen.toEnumValue("5", "kotlin.Float"), "5f");
assertEquals(codegen.toEnumValue("1.0", "kotlin.Float"), "1.0f");
assertEquals(codegen.toEnumValue("data", "Something"), "\"data\"");
}
private class P_AbstractKotlinCodegen extends AbstractKotlinCodegen {
@Override
@ -66,4 +79,11 @@ public class AbstractKotlinCodegenTest {
return null;
}
}
@Test
public void isDataTypeString(){
assertFalse(codegen.isDataTypeString("kotlin.Int"));
assertTrue(codegen.isDataTypeString("kotlin.String"));
assertTrue(codegen.isDataTypeString("String"));
}
}

View File

@ -310,12 +310,14 @@ public class PhpModelTest {
Assert.assertTrue(prope.isEnum);
Assert.assertEquals(prope.allowableValues.get("values"), Arrays.asList("fish", "crab"));
HashMap<String, String> fish= new HashMap<String, String>();
HashMap<String, Object> fish= new HashMap<String, Object>();
fish.put("name", "FISH");
fish.put("value", "\'fish\'");
HashMap<String, String> crab= new HashMap<String, String>();
fish.put("isString", false);
HashMap<String, Object> crab= new HashMap<String, Object>();
crab.put("name", "CRAB");
crab.put("value", "\'crab\'");
crab.put("isString", false);
Assert.assertEquals(prope.allowableValues.get("enumVars"), Arrays.asList(fish, crab));
// assert inner items
@ -343,12 +345,14 @@ public class PhpModelTest {
Assert.assertNull(prope.items);
Assert.assertEquals(prope.allowableValues.get("values"), Arrays.asList(1, -1));
HashMap<String, String> one = new HashMap<String, String>();
HashMap<String, Object> one = new HashMap<String, Object>();
one.put("name", "1");
one.put("value", "1");
HashMap<String, String> minusOne = new HashMap<String, String>();
one.put("isString", false);
HashMap<String, Object> minusOne = new HashMap<String, Object>();
minusOne.put("name", "MINUS_1");
minusOne.put("value", "-1");
minusOne.put("isString", false);
Assert.assertEquals(prope.allowableValues.get("enumVars"), Arrays.asList(one, minusOne));
}

View File

@ -234,12 +234,14 @@ public class TypeScriptFetchModelTest {
Assert.assertTrue(prope.isEnum);
Assert.assertEquals(prope.allowableValues.get("values"), Arrays.asList("fish", "crab"));
HashMap<String, String> fish = new HashMap<String, String>();
HashMap<String, Object> fish = new HashMap<String, Object>();
fish.put("name", "Fish");
fish.put("value", "'fish'");
HashMap<String, String> crab = new HashMap<String, String>();
fish.put("isString", false);
HashMap<String, Object> crab = new HashMap<String, Object>();
crab.put("name", "Crab");
crab.put("value", "'crab'");
crab.put("isString", false);
Assert.assertEquals(prope.allowableValues.get("enumVars"), Arrays.asList(fish, crab));
// assert inner items
@ -270,12 +272,14 @@ public class TypeScriptFetchModelTest {
Assert.assertNull(prope.items);
Assert.assertEquals(prope.allowableValues.get("values"), Arrays.asList(1, -1));
HashMap<String, String> one = new HashMap<String, String>();
HashMap<String, Object> one = new HashMap<String, Object>();
one.put("name", "NUMBER_1");
one.put("value", "1");
HashMap<String, String> minusOne = new HashMap<String, String>();
one.put("isString", false);
HashMap<String, Object> minusOne = new HashMap<String, Object>();
minusOne.put("name", "NUMBER_MINUS_1");
minusOne.put("value", "-1");
minusOne.put("isString", false);
Assert.assertEquals(prope.allowableValues.get("enumVars"), Arrays.asList(one, minusOne));
//IMPORTANT: these are not final enum values, which may be further updated

View File

@ -16,3 +16,61 @@ paths:
default:
description: "Internal server error"
summary: Test
definitions:
MapTest:
type: object
properties:
direct_map:
type: object
additionalProperties:
type: boolean
indirect_map:
$ref: "#/definitions/StringBooleanMap"
ref_test:
$ref: "#/definitions/StringRef"
direct_test:
type: string
StringBooleanMap:
additionalProperties:
type: boolean
StringRef:
type: string
Pet:
title: a Pet
description: A pet for sale in the pet store
type: object
properties:
id:
type: integer
format: int64
category:
$ref: '#/definitions/Category'
tags:
type: array
xml:
name: tag
wrapped: true
items:
$ref: '#/definitions/Tag'
Tag:
title: Pet Tag
description: A tag for a pet
type: object
properties:
id:
type: integer
format: int64
name:
type: string
Category:
title: Pet category
description: A category for a pet
type: object
properties:
id:
type: integer
format: int64
name:
type: string
xml:
name: Category

View File

@ -1355,6 +1355,12 @@ definitions:
enum:
- UPPER
- lower
direct_map:
type: object
additionalProperties:
type: boolean
indirect_map:
$ref: "#/definitions/StringBooleanMap"
ArrayTest:
type: object
properties:
@ -1452,3 +1458,6 @@ definitions:
OuterBoolean:
type: boolean
x-codegen-body-parameter-name: boolean_post_body
StringBooleanMap:
additionalProperties:
type: boolean

View File

@ -9,7 +9,7 @@
<artifactId>openapi-generator-project</artifactId>
<packaging>pom</packaging>
<name>openapi-generator-project</name>
<version>3.0.3</version>
<version>3.1.0-SNAPSHOT</version>
<url>https://github.com/openapitools/openapi-generator</url>
<scm>
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>

View File

@ -97,6 +97,7 @@ Class | Method | HTTP request | Description
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Return](docs/Return.md)
- [SpecialModelName](docs/SpecialModelName.md)
- [StringBooleanMap](docs/StringBooleanMap.md)
- [Tag](docs/Tag.md)
- [User](docs/User.md)

View File

@ -1276,14 +1276,18 @@ components:
type: array
type: object
OuterComposite:
example: {}
example:
my_string: my_string
my_number: 0.80082819046101150206595775671303272247314453125
my_boolean: true
properties:
my_number:
$ref: '#/components/schemas/OuterNumber'
type: number
my_string:
$ref: '#/components/schemas/OuterString'
type: string
my_boolean:
$ref: '#/components/schemas/OuterBoolean'
type: boolean
x-codegen-body-parameter-name: boolean_post_body
type: object
format_test:
properties:
@ -1381,6 +1385,10 @@ components:
required:
- className
type: object
StringBooleanMap:
additionalProperties:
type: boolean
type: object
Cat:
allOf:
- $ref: '#/components/schemas/Animal'
@ -1403,6 +1411,12 @@ components:
- lower
type: string
type: object
direct_map:
additionalProperties:
type: boolean
type: object
indirect_map:
$ref: '#/components/schemas/StringBooleanMap'
type: object
Tag:
example:

View File

@ -5,6 +5,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional]
**MapOfEnumString** | **map[string]string** | | [optional]
**DirectMap** | **map[string]bool** | | [optional]
**IndirectMap** | [***StringBooleanMap**](StringBooleanMap.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -12,4 +12,6 @@ package petstore
type MapTest struct {
MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"`
MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"`
DirectMap map[string]bool `json:"direct_map,omitempty"`
IndirectMap *StringBooleanMap `json:"indirect_map,omitempty"`
}

View File

@ -0,0 +1,13 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package petstore
type StringBooleanMap struct {
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -70,6 +71,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -122,6 +129,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -133,12 +184,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -149,6 +202,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -82,7 +82,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -70,6 +71,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -122,6 +129,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -133,12 +184,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -149,6 +202,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -82,7 +82,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -70,6 +71,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -122,6 +129,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -133,12 +184,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -149,6 +202,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -82,7 +82,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -69,6 +70,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -121,6 +128,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -132,12 +183,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return ObjectUtils.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
ObjectUtils.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
ObjectUtils.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
ObjectUtils.equals(this.directMap, mapTest.directMap) &&
ObjectUtils.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return ObjectUtils.hashCodeMulti(mapMapOfString, mapOfEnumString);
return ObjectUtils.hashCodeMulti(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -148,6 +201,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -81,7 +81,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,64 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import org.apache.commons.lang3.ObjectUtils;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return ObjectUtils.hashCodeMulti(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -70,6 +71,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -122,6 +129,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -133,12 +184,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -149,6 +202,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -82,7 +82,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -70,6 +71,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -122,6 +129,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -133,12 +184,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -149,6 +202,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -82,7 +82,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -26,6 +26,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
import android.os.Parcelable;
import android.os.Parcel;
@ -89,6 +90,14 @@ public class MapTest implements Parcelable {
@SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING)
private Map<String, InnerEnum> mapOfEnumString = null;
public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map";
@SerializedName(SERIALIZED_NAME_DIRECT_MAP)
private Map<String, Boolean> directMap = null;
public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map";
@SerializedName(SERIALIZED_NAME_INDIRECT_MAP)
private StringBooleanMap indirectMap = null;
public MapTest() {
}
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
@ -143,6 +152,50 @@ public class MapTest implements Parcelable {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -154,12 +207,14 @@ public class MapTest implements Parcelable {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -170,6 +225,8 @@ public class MapTest implements Parcelable {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}
@ -189,11 +246,15 @@ public class MapTest implements Parcelable {
public void writeToParcel(Parcel out, int flags) {
out.writeValue(mapMapOfString);
out.writeValue(mapOfEnumString);
out.writeValue(directMap);
out.writeValue(indirectMap);
}
MapTest(Parcel in) {
mapMapOfString = (Map<String, Map<String, String>>)in.readValue(Map.class.getClassLoader());
mapOfEnumString = (Map<String, InnerEnum>)in.readValue(null);
directMap = (Map<String, Boolean>)in.readValue(null);
indirectMap = (StringBooleanMap)in.readValue(StringBooleanMap.class.getClassLoader());
}
public int describeContents() {

View File

@ -92,7 +92,7 @@ public class OuterComposite implements Parcelable {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,91 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import android.os.Parcelable;
import android.os.Parcel;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> implements Parcelable {
public StringBooleanMap() {
super();
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public void writeToParcel(Parcel out, int flags) {
super.writeToParcel(out, flags);
}
StringBooleanMap(Parcel in) {
super(in);
}
public int describeContents() {
return 0;
}
public static final Parcelable.Creator<StringBooleanMap> CREATOR = new Parcelable.Creator<StringBooleanMap>() {
public StringBooleanMap createFromParcel(Parcel in) {
return new StringBooleanMap(in);
}
public StringBooleanMap[] newArray(int size) {
return new StringBooleanMap[size];
}
};
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -26,6 +26,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -87,6 +88,14 @@ public class MapTest {
@SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING)
private Map<String, InnerEnum> mapOfEnumString = null;
public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map";
@SerializedName(SERIALIZED_NAME_DIRECT_MAP)
private Map<String, Boolean> directMap = null;
public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map";
@SerializedName(SERIALIZED_NAME_INDIRECT_MAP)
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -139,6 +148,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -150,12 +203,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -166,6 +221,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -88,7 +88,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -26,6 +26,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -87,6 +88,14 @@ public class MapTest {
@SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING)
private Map<String, InnerEnum> mapOfEnumString = null;
public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map";
@SerializedName(SERIALIZED_NAME_DIRECT_MAP)
private Map<String, Boolean> directMap = null;
public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map";
@SerializedName(SERIALIZED_NAME_INDIRECT_MAP)
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -139,6 +148,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -150,12 +203,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -166,6 +221,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -88,7 +88,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
/**
* MapTest
@ -70,6 +71,12 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -122,6 +129,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -133,12 +184,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -149,6 +202,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -82,7 +82,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

View File

@ -0,0 +1,65 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* StringBooleanMap
*/
public class StringBooleanMap extends HashMap<String, Boolean> {
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StringBooleanMap {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT

View File

@ -6,6 +6,8 @@ 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** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
<a name="Map<String, InnerEnum>"></a>

View File

@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.client.model.StringBooleanMap;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
import javax.xml.bind.annotation.*;
@ -83,6 +84,18 @@ public class MapTest {
@XmlElement(name = "inner")
private Map<String, InnerEnum> mapOfEnumString = null;
@JsonProperty("direct_map")
// Is a container wrapped=false
// items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace=
// items.example= items.type=Boolean
@XmlElement(name = "inner")
private Map<String, Boolean> directMap = null;
@JsonProperty("indirect_map")
@JacksonXmlProperty(localName = "indirect_map")
@XmlElement(name = "indirect_map")
private StringBooleanMap indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;
return this;
@ -135,6 +148,50 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
return this;
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
}
this.directMap.put(key, directMapItem);
return this;
}
/**
* Get directMap
* @return directMap
**/
@ApiModelProperty(value = "")
public Map<String, Boolean> getDirectMap() {
return directMap;
}
public void setDirectMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
}
public MapTest indirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
return this;
}
/**
* Get indirectMap
* @return indirectMap
**/
@ApiModelProperty(value = "")
public StringBooleanMap getIndirectMap() {
return indirectMap;
}
public void setIndirectMap(StringBooleanMap indirectMap) {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(java.lang.Object o) {
@ -146,12 +203,14 @@ public class MapTest {
}
MapTest mapTest = (MapTest) o;
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
Objects.equals(this.directMap, mapTest.directMap) &&
Objects.equals(this.indirectMap, mapTest.indirectMap);
}
@Override
public int hashCode() {
return Objects.hash(mapMapOfString, mapOfEnumString);
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
}
@ -162,6 +221,8 @@ public class MapTest {
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@ -93,7 +93,7 @@ public class OuterComposite {
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
public Boolean isMyBoolean() {
return myBoolean;
}

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