mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-24 01:39:08 +00:00
[Kotlin][server] Add kotlin-vertx-server (#3031)
* add kotlin-vertx * add kotlin-vertx * update kotlin server * update * move Fsharp... in Config * replace java model to kotlin model. delete useless code * add kotlin-vertx readme.md * add kotlin-vertx * add model null safety * change to vert.x offical web api * fix date and datetime missing * fix fileupload
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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 or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import org.openapitools.codegen.CodegenConstants;
|
||||
import org.openapitools.codegen.CodegenType;
|
||||
import org.openapitools.codegen.SupportingFile;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
|
||||
public class KotlinVertxServerCodegen extends AbstractKotlinCodegen {
|
||||
|
||||
protected String rootPackage = "org.openapitools.server.api";
|
||||
protected String apiVersion = "1.0.0-SNAPSHOT";
|
||||
|
||||
public static final String ROOT_PACKAGE = "rootPackage";
|
||||
|
||||
public static final String PROJECT_NAME = "projectName";
|
||||
|
||||
static Logger LOGGER = LoggerFactory.getLogger(KotlinVertxServerCodegen.class);
|
||||
|
||||
public CodegenType getTag() {
|
||||
return CodegenType.SERVER;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "kotlin-vertx";
|
||||
}
|
||||
|
||||
public String getHelp() {
|
||||
return "Generates a kotlin-vertx server.";
|
||||
}
|
||||
|
||||
public KotlinVertxServerCodegen() {
|
||||
super();
|
||||
|
||||
outputFolder = "generated-code" + File.separator + "kotlin-vertx";
|
||||
modelTemplateFiles.put("model.mustache", ".kt");
|
||||
|
||||
apiTestTemplateFiles.clear();
|
||||
modelDocTemplateFiles.clear();
|
||||
supportingFiles.clear();
|
||||
|
||||
apiTemplateFiles.clear();
|
||||
apiTemplateFiles.put("api.mustache", ".kt");
|
||||
apiTemplateFiles.put("apiProxy.mustache", "VertxProxyHandler.kt");
|
||||
apiTemplateFiles.put("api_verticle.mustache","Verticle.kt");
|
||||
|
||||
embeddedTemplateDir = templateDir = "kotlin-vertx-server";
|
||||
apiPackage = rootPackage + ".verticle";
|
||||
modelPackage = rootPackage + ".model";
|
||||
artifactId = "openapi-kotlin-vertx-server";
|
||||
artifactVersion = apiVersion;
|
||||
|
||||
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
||||
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
|
||||
additionalProperties.put(ROOT_PACKAGE, rootPackage);
|
||||
|
||||
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
|
||||
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeReservedWord(String name) {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user