forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/OpenAPITools/openapi-generator
This commit is contained in:
commit
2c9bfdf29a
@ -12,5 +12,5 @@ sidebar_label: cpp-qt5-client
|
|||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|modelNamePrefix|Prefix that will be prepended to all model names.| |OAI|
|
||||||
|optionalProjectFile|Generate client.pri.| |true|
|
|optionalProjectFile|Generate client.pri.| |true|
|
||||||
|
@ -12,4 +12,4 @@ sidebar_label: cpp-qt5-qhttpengine-server
|
|||||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
||||||
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
|
|modelNamePrefix|Prefix that will be prepended to all model names.| |OAI|
|
||||||
|
@ -203,10 +203,10 @@ public class CodegenConstants {
|
|||||||
public static final String ENUM_PROPERTY_NAMING_DESC = "Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'";
|
public static final String ENUM_PROPERTY_NAMING_DESC = "Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'";
|
||||||
|
|
||||||
public static final String MODEL_NAME_PREFIX = "modelNamePrefix";
|
public static final String MODEL_NAME_PREFIX = "modelNamePrefix";
|
||||||
public static final String MODEL_NAME_PREFIX_DESC = "Prefix that will be prepended to all model names. Default is the empty string.";
|
public static final String MODEL_NAME_PREFIX_DESC = "Prefix that will be prepended to all model names.";
|
||||||
|
|
||||||
public static final String MODEL_NAME_SUFFIX = "modelNameSuffix";
|
public static final String MODEL_NAME_SUFFIX = "modelNameSuffix";
|
||||||
public static final String MODEL_NAME_SUFFIX_DESC = "Suffix that will be appended to all model names. Default is the empty string.";
|
public static final String MODEL_NAME_SUFFIX_DESC = "Suffix that will be appended to all model names.";
|
||||||
|
|
||||||
public static final String GIT_USER_ID = "gitUserId";
|
public static final String GIT_USER_ID = "gitUserId";
|
||||||
public static final String GIT_USER_ID_DESC = "Git user ID, e.g. openapitools.";
|
public static final String GIT_USER_ID_DESC = "Git user ID, e.g. openapitools.";
|
||||||
|
@ -5,6 +5,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
|||||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.CodegenConfig;
|
import org.openapitools.codegen.CodegenConfig;
|
||||||
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenModel;
|
import org.openapitools.codegen.CodegenModel;
|
||||||
import org.openapitools.codegen.CodegenOperation;
|
import org.openapitools.codegen.CodegenOperation;
|
||||||
import org.openapitools.codegen.CodegenParameter;
|
import org.openapitools.codegen.CodegenParameter;
|
||||||
@ -34,6 +35,7 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen
|
|||||||
}
|
}
|
||||||
// CLI options
|
// CLI options
|
||||||
addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace);
|
addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace);
|
||||||
|
addOption(CodegenConstants.MODEL_NAME_PREFIX, CodegenConstants.MODEL_NAME_PREFIX_DESC, this.modelNamePrefix);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Additional Properties. These values can be passed to the templates and
|
* Additional Properties. These values can be passed to the templates and
|
||||||
@ -45,9 +47,7 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen
|
|||||||
// Write defaults namespace in properties so that it can be accessible in templates.
|
// Write defaults namespace in properties so that it can be accessible in templates.
|
||||||
// At this point command line has not been parsed so if value is given
|
// At this point command line has not been parsed so if value is given
|
||||||
// in command line it will supersede this content
|
// in command line it will supersede this content
|
||||||
additionalProperties.put("cppNamespace", cppNamespace);
|
additionalProperties.put("cppNamespace", cppNamespace);
|
||||||
// CLI options
|
|
||||||
addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace);
|
|
||||||
/*
|
/*
|
||||||
* Language Specific Primitives. These types will not trigger imports by
|
* Language Specific Primitives. These types will not trigger imports by
|
||||||
* the client generator
|
* the client generator
|
||||||
@ -112,7 +112,9 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen
|
|||||||
}
|
}
|
||||||
|
|
||||||
additionalProperties.put("cppNamespaceDeclarations", cppNamespace.split("\\::"));
|
additionalProperties.put("cppNamespaceDeclarations", cppNamespace.split("\\::"));
|
||||||
|
|
||||||
if (additionalProperties.containsKey("modelNamePrefix")) {
|
if (additionalProperties.containsKey("modelNamePrefix")) {
|
||||||
|
modelNamePrefix = (String) additionalProperties.get("modelNamePrefix");
|
||||||
typeMapping.put("object", modelNamePrefix + "Object");
|
typeMapping.put("object", modelNamePrefix + "Object");
|
||||||
additionalProperties().put("prefix", modelNamePrefix);
|
additionalProperties().put("prefix", modelNamePrefix);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user