forked from loafle/openapi-generator-original
This reverts commit dd3bba8c9442f2ee40d6ea8f0872ab0be43714b9. Because it broke peoples builds per this issue https://github.com/OpenAPITools/openapi-generator/issues/11276
This commit is contained in:
parent
d8cb6bd894
commit
57987424a4
@ -2,6 +2,7 @@ generatorName: python-experimental
|
|||||||
outputDir: samples/openapi3/client/petstore/python-experimental
|
outputDir: samples/openapi3/client/petstore/python-experimental
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/python-experimental
|
templateDir: modules/openapi-generator/src/main/resources/python-experimental
|
||||||
|
templatingEngineName: handlebars
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
packageName: petstore_api
|
packageName: petstore_api
|
||||||
recursionLimit: "1234"
|
recursionLimit: "1234"
|
||||||
|
@ -46,7 +46,7 @@ public class WorkflowSettings {
|
|||||||
public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false;
|
public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false;
|
||||||
public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true;
|
public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true;
|
||||||
public static final boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false;
|
public static final boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false;
|
||||||
public static final String DEFAULT_TEMPLATING_ENGINE_NAME = null; // this is set by the generator
|
public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache";
|
||||||
public static final Map<String, String> DEFAULT_GLOBAL_PROPERTIES = Collections.unmodifiableMap(new HashMap<>());
|
public static final Map<String, String> DEFAULT_GLOBAL_PROPERTIES = Collections.unmodifiableMap(new HashMap<>());
|
||||||
|
|
||||||
private String inputSpec;
|
private String inputSpec;
|
||||||
|
@ -305,8 +305,6 @@ public interface CodegenConfig {
|
|||||||
|
|
||||||
Schema unaliasSchema(Schema schema, Map<String, String> usedImportMappings);
|
Schema unaliasSchema(Schema schema, Map<String, String> usedImportMappings);
|
||||||
|
|
||||||
public String defaultTemplatingEngine();
|
|
||||||
|
|
||||||
public GeneratorLanguage generatorLanguage();
|
public GeneratorLanguage generatorLanguage();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -7357,11 +7357,6 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
return xOf;
|
return xOf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String defaultTemplatingEngine() {
|
|
||||||
return "mustache";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVA; }
|
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVA; }
|
||||||
|
|
||||||
|
@ -91,18 +91,11 @@ public class CodegenConfigurator {
|
|||||||
WorkflowSettings workflowSettings = settings.getWorkflowSettings();
|
WorkflowSettings workflowSettings = settings.getWorkflowSettings();
|
||||||
List<TemplateDefinition> userDefinedTemplateSettings = settings.getFiles();
|
List<TemplateDefinition> userDefinedTemplateSettings = settings.getFiles();
|
||||||
|
|
||||||
CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName());
|
|
||||||
String templatingEngineName = workflowSettings.getTemplatingEngineName();
|
|
||||||
if (isEmpty(templatingEngineName)) {
|
|
||||||
// if templatingEngineName is empty check the config for a default
|
|
||||||
templatingEngineName = config.defaultTemplatingEngine();
|
|
||||||
}
|
|
||||||
|
|
||||||
// We copy "cached" properties into configurator so it is appropriately configured with all settings in external files.
|
// We copy "cached" properties into configurator so it is appropriately configured with all settings in external files.
|
||||||
// FIXME: target is to eventually move away from CodegenConfigurator properties except gen/workflow settings.
|
// FIXME: target is to eventually move away from CodegenConfigurator properties except gen/workflow settings.
|
||||||
configurator.generatorName = generatorSettings.getGeneratorName();
|
configurator.generatorName = generatorSettings.getGeneratorName();
|
||||||
configurator.inputSpec = workflowSettings.getInputSpec();
|
configurator.inputSpec = workflowSettings.getInputSpec();
|
||||||
configurator.templatingEngineName = templatingEngineName;
|
configurator.templatingEngineName = workflowSettings.getTemplatingEngineName();
|
||||||
if (workflowSettings.getGlobalProperties() != null) {
|
if (workflowSettings.getGlobalProperties() != null) {
|
||||||
configurator.globalProperties.putAll(workflowSettings.getGlobalProperties());
|
configurator.globalProperties.putAll(workflowSettings.getGlobalProperties());
|
||||||
}
|
}
|
||||||
@ -489,17 +482,15 @@ public class CodegenConfigurator {
|
|||||||
Validate.notEmpty(generatorName, "generator name must be specified");
|
Validate.notEmpty(generatorName, "generator name must be specified");
|
||||||
Validate.notEmpty(inputSpec, "input spec must be specified");
|
Validate.notEmpty(inputSpec, "input spec must be specified");
|
||||||
|
|
||||||
GeneratorSettings generatorSettings = generatorSettingsBuilder.build();
|
|
||||||
CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName());
|
|
||||||
if (isEmpty(templatingEngineName)) {
|
if (isEmpty(templatingEngineName)) {
|
||||||
// if templatingEngineName is empty check the config for a default
|
// Built-in templates are mustache, but allow users to use a simplified handlebars engine for their custom templates.
|
||||||
String defaultTemplatingEngine = config.defaultTemplatingEngine();
|
workflowSettingsBuilder.withTemplatingEngineName("mustache");
|
||||||
workflowSettingsBuilder.withTemplatingEngineName(defaultTemplatingEngine);
|
|
||||||
} else {
|
} else {
|
||||||
workflowSettingsBuilder.withTemplatingEngineName(templatingEngineName);
|
workflowSettingsBuilder.withTemplatingEngineName(templatingEngineName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// at this point, all "additionalProperties" are set, and are now immutable per GeneratorSettings instance.
|
// at this point, all "additionalProperties" are set, and are now immutable per GeneratorSettings instance.
|
||||||
|
GeneratorSettings generatorSettings = generatorSettingsBuilder.build();
|
||||||
WorkflowSettings workflowSettings = workflowSettingsBuilder.build();
|
WorkflowSettings workflowSettings = workflowSettingsBuilder.build();
|
||||||
|
|
||||||
if (workflowSettings.isVerbose()) {
|
if (workflowSettings.isVerbose()) {
|
||||||
|
@ -2086,11 +2086,6 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
|
|||||||
return co;
|
return co;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String defaultTemplatingEngine() {
|
|
||||||
return "handlebars";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String generatorLanguageVersion() { return ">=3.9"; };
|
public String generatorLanguageVersion() { return ">=3.9"; };
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user