forked from loafle/openapi-generator-original
[MAVEN PLUGIN] Checking for null configOptions before looking for property (#7613)
* Checking for null configOptions * Inline configOptions check
This commit is contained in:
parent
f41683a5ba
commit
0a28aad73b
@ -2,12 +2,12 @@ package io.swagger.codegen.plugin;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2001-2005 The Apache Software Foundation.
|
* Copyright 2001-2005 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License. You may obtain a copy of the License at
|
* in compliance with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||||
* or implied. See the License for the specific language governing permissions and limitations under
|
* or implied. See the License for the specific language governing permissions and limitations under
|
||||||
@ -210,6 +210,9 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of additional properties that can be referenced by the mustache templates
|
* A map of additional properties that can be referenced by the mustache templates
|
||||||
|
* <additionalProperties>
|
||||||
|
* <additionalProperty>key=value</additionalProperty>
|
||||||
|
* </additionalProperties>
|
||||||
*/
|
*/
|
||||||
@Parameter(name = "additionalProperties")
|
@Parameter(name = "additionalProperties")
|
||||||
private List<String> additionalProperties;
|
private List<String> additionalProperties;
|
||||||
@ -218,7 +221,7 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
* A map of reserved names and how they should be escaped
|
* A map of reserved names and how they should be escaped
|
||||||
*/
|
*/
|
||||||
@Parameter(name = "reservedWordsMappings")
|
@Parameter(name = "reservedWordsMappings")
|
||||||
private List<String> reservedWordsMappings;
|
private List<String> reservedWordsMappings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the apis
|
* Generate the apis
|
||||||
@ -466,32 +469,32 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Apply Instantiation Types
|
//Apply Instantiation Types
|
||||||
if (instantiationTypes != null && !configOptions.containsKey("instantiation-types")) {
|
if (instantiationTypes != null && (configOptions == null || !configOptions.containsKey("instantiation-types"))) {
|
||||||
applyInstantiationTypesKvpList(instantiationTypes, configurator);
|
applyInstantiationTypesKvpList(instantiationTypes, configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Apply Import Mappings
|
//Apply Import Mappings
|
||||||
if (importMappings != null && !configOptions.containsKey("import-mappings")) {
|
if (importMappings != null && (configOptions == null || !configOptions.containsKey("import-mappings"))) {
|
||||||
applyImportMappingsKvpList(importMappings, configurator);
|
applyImportMappingsKvpList(importMappings, configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Apply Type Mappings
|
//Apply Type Mappings
|
||||||
if (typeMappings != null && !configOptions.containsKey("type-mappings")) {
|
if (typeMappings != null && (configOptions == null || !configOptions.containsKey("type-mappings"))) {
|
||||||
applyTypeMappingsKvpList(typeMappings, configurator);
|
applyTypeMappingsKvpList(typeMappings, configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Apply Language Specific Primitives
|
//Apply Language Specific Primitives
|
||||||
if (languageSpecificPrimitives != null && !configOptions.containsKey("language-specific-primitives")) {
|
if (languageSpecificPrimitives != null && (configOptions == null || !configOptions.containsKey("language-specific-primitives"))) {
|
||||||
applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator);
|
applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Apply Additional Properties
|
//Apply Additional Properties
|
||||||
if (additionalProperties != null && !configOptions.containsKey("additional-properties")) {
|
if (additionalProperties != null && (configOptions == null || !configOptions.containsKey("additional-properties"))) {
|
||||||
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
|
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Apply Reserved Words Mappings
|
//Apply Reserved Words Mappings
|
||||||
if (reservedWordsMappings != null && !configOptions.containsKey("reserved-words-mappings")) {
|
if (reservedWordsMappings != null && (configOptions == null || !configOptions.containsKey("reserved-words-mappings"))) {
|
||||||
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
|
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user