Skip to content

Commit

Permalink
Rename sagger metadata and more (OpenAPITools#208)
Browse files Browse the repository at this point in the history
* Rename groupId, artifactId, project name, title, ...
* Remove .swagger-codegen/VERSION file
  • Loading branch information
jmini authored Apr 24, 2018
1 parent 7fe555a commit 5340c35
Show file tree
Hide file tree
Showing 50 changed files with 128 additions and 123 deletions.
2 changes: 1 addition & 1 deletion bin/utils/detect_merge_conflict.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# grep for '<<<<<<< HEAD' in openapi generator
# grep for '<<<<<<< HEAD' in openapi-generator
grep -RUIl '<<<<<<< HEAD' modules/openapi-generator/src

if [ $? -ne 1 ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* User: lanwen Date: 24.03.15 Time: 17:56
* <p>
* Command line interface for openapi generator use `openapi-generator-cli.jar help` for more info
* Command line interface for OpenAPI Generator use `openapi-generator-cli.jar help` for more info
*
* @since 2.1.3-M1
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<artifactId>openapi-generator-maven-plugin</artifactId>
<name>openapi-generator (maven-plugin)</name>
<packaging>maven-plugin</packaging>
<description>maven plugin to build modules from openapi generator</description>
<description>maven plugin to build modules from OpenAPI Generator</description>
<prerequisites>
<maven>3.2.5</maven>
</prerequisites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
public static final String OPTIONAL_EMIT_DEFAULT_VALUES_DESC = "Set DataMember's EmitDefaultValue.";

public static final String GIT_USER_ID = "gitUserId";
public static final String GIT_USER_ID_DESC = "Git user ID, e.g. swagger-api.";
public static final String GIT_USER_ID_DESC = "Git user ID, e.g. openapitools.";

public static final String GIT_REPO_ID = "gitRepoId";
public static final String GIT_REPO_ID_DESC = "Git repo ID, e.g. swagger-codegen.";
public static final String GIT_REPO_ID_DESC = "Git repo ID, e.g. openapi-generator.";

public static final String RELEASE_NOTE = "releaseNote";
public static final String RELEASE_NOTE_DESC = "Release note, default to 'Minor update'.";

public static final String HTTP_USER_AGENT = "httpUserAgent";
public static final String HTTP_USER_AGENT_DESC = "HTTP user agent, e.g. codegen_csharp_api_client, default to 'Swagger-Codegen/{packageVersion}}/{language}'";
public static final String HTTP_USER_AGENT_DESC = "HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}}/{language}'";

public static final String SUPPORTS_ES6 = "supportsES6";
public static final String SUPPORTS_ES6_DESC = "Generate code that conforms to ES6.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3785,7 +3785,7 @@ public String getIgnoreFilePathOverride() {
}

/**
* Sets an override location for the .swagger-codegen.ignore location for the first code generation.
* Sets an override location for the '.openapi-generator-ignore' location for the first code generation.
*
* @param ignoreFileOverride The full path to an ignore file
*/
Expand Down Expand Up @@ -4239,7 +4239,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Map<String, Schema> sc
final ArraySchema arraySchema = (ArraySchema) schema;
Schema inner = arraySchema.getItems();
if (inner == null) {
inner = new StringSchema().description("//TODO automatically added by swagger-codegen");
inner = new StringSchema().description("//TODO automatically added by openapi-generator");
arraySchema.setItems(inner);
}
CodegenProperty codegenProperty = fromProperty("property", schema);
Expand Down Expand Up @@ -4272,7 +4272,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Map<String, Schema> sc
} else if (ModelUtils.isMapSchema(schema)) {
Schema inner = (Schema) schema.getAdditionalProperties();
if (inner == null) {
inner = new StringSchema().description("//TODO automatically added by swagger-codegen");
inner = new StringSchema().description("//TODO automatically added by openapi-generator");
schema.setAdditionalProperties(inner);
}
CodegenProperty codegenProperty = fromProperty("property", schema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Generator opts(ClientOptInput opts) {
}

/**
* Programmatically disable the output of .swagger-codegen/VERSION, .openapi-generator-ignore,
* Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore,
* or other metadata files used by Swagger Codegen.
* @param generateMetadata true: enable outputs, false: disable outputs
*/
Expand Down Expand Up @@ -676,7 +676,7 @@ public Reader getTemplate(String name) {
/*
* The following code adds default LICENSE (Apache-2.0) for all generators
* To use license other than Apache2.0, update the following file:
* modules/swagger-codegen/src/main/resources/_common/LICENSE
* modules/openapi-generator/src/main/resources/_common/LICENSE
*
final String apache2License = "LICENSE";
String licenseFileNameTarget = config.outputFolder() + File.separator + apache2License;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected boolean java8Mode = false;
protected boolean withXml = false;
protected String invokerPackage = "io.swagger";
protected String groupId = "io.swagger";
protected String artifactId = "swagger-java";
protected String groupId = "org.openapitools";
protected String artifactId = "openapi-java";
protected String artifactVersion = "1.0.0";
protected String artifactUrl = "https://github.com/swagger-api/swagger-codegen";
protected String artifactDescription = "Swagger Java";
protected String developerName = "Swagger";
protected String developerEmail = "[email protected]";
protected String developerOrganization = "Swagger";
protected String developerOrganizationUrl = "http://swagger.io";
protected String scmConnection = "scm:git:[email protected]:swagger-api/swagger-codegen.git";
protected String scmDeveloperConnection = "scm:git:[email protected]:swagger-api/swagger-codegen.git";
protected String scmUrl = "https://github.com/swagger-api/swagger-codegen";
protected String artifactUrl = "https://github.com/openapitools/openapi-generator";
protected String artifactDescription = "OpenAPI Java";
protected String developerName = "OpenAPI";
protected String developerEmail = "[email protected]";
protected String developerOrganization = "OpenAPI";
protected String developerOrganizationUrl = "http://openapitools.org";
protected String scmConnection = "scm:git:[email protected]:openapitools/openapi-generator.git";
protected String scmDeveloperConnection = "scm:git:[email protected]:openapitools/openapi-generator.git";
protected String scmUrl = "https://github.com/openapitools/openapi-generator";
protected String licenseName = "Unlicense";
protected String licenseUrl = "http://unlicense.org";
protected String projectFolder = "src" + File.separator + "main";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
protected static final String JAXRS_TEMPLATE_DIRECTORY_NAME = "JavaJaxRS";
protected String implFolder = "src/main/java";
protected String testResourcesFolder = "src/test/resources";
protected String title = "Swagger Server";
protected String title = "OpenAPI Server";

protected boolean useBeanValidation = true;

Expand All @@ -41,7 +41,7 @@ public AbstractJavaJAXRSServerCodegen() {

sourceFolder = "src/gen/java";
invokerPackage = "org.openapitools.api";
artifactId = "swagger-jaxrs-server";
artifactId = "openapi-jaxrs-server";
dateLibrary = "legacy"; //TODO: add joda support to all jax-rs

apiPackage = "org.openapitools.api";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co

protected String artifactId;
protected String artifactVersion = "1.0.0";
protected String groupId = "io.swagger";
protected String groupId = "org.openapitools";
protected String packageName;

protected String sourceFolder = "src/main/kotlin";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ public AbstractPhpCodegen() {
cliOptions.add(new CliOption(CodegenConstants.INVOKER_PACKAGE, "The main namespace to use for all classes. e.g. Yay\\Pets"));
cliOptions.add(new CliOption(PACKAGE_PATH, "The main package name for classes. e.g. GeneratedPetstore"));
cliOptions.add(new CliOption(SRC_BASE_PATH, "The directory under packagePath to serve as source root."));
// cliOptions.add(new CliOption(COMPOSER_VENDOR_NAME, "The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets. IMPORTANT NOTE (2016/03): composerVendorName will be deprecated and replaced by gitUserId in the next swagger-codegen release"));
// cliOptions.add(new CliOption(COMPOSER_VENDOR_NAME, "The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets. IMPORTANT NOTE (2016/03): composerVendorName will be deprecated and replaced by gitUserId in the next openapi-generator release"));
cliOptions.add(new CliOption(CodegenConstants.GIT_USER_ID, CodegenConstants.GIT_USER_ID_DESC));
// cliOptions.add(new CliOption(COMPOSER_PROJECT_NAME, "The project name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. petstore-client. IMPORTANT NOTE (2016/03): composerProjectName will be deprecated and replaced by gitRepoId in the next swagger-codegen release"));
// cliOptions.add(new CliOption(COMPOSER_PROJECT_NAME, "The project name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. petstore-client. IMPORTANT NOTE (2016/03): composerProjectName will be deprecated and replaced by gitRepoId in the next openapi-generator release"));
cliOptions.add(new CliOption(CodegenConstants.GIT_REPO_ID, CodegenConstants.GIT_REPO_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, "The version to use in the composer package version field. e.g. 1.2.3"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
public static final String ANDROID_SDK_VERSION = "androidSdkVersion";
public static final String ANDROID_BUILD_TOOLS_VERSION = "androidBuildToolsVersion";
protected String invokerPackage = "io.swagger.client";
protected String groupId = "io.swagger";
protected String artifactId = "swagger-android-client";
protected String groupId = "org.openapitools";
protected String artifactId = "openapi-android-client";
protected String artifactVersion = "1.0.0";
protected String projectFolder = "src/main";
protected String sourceFolder = projectFolder + "/java";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ClojureClientCodegen() {
embeddedTemplateDir = templateDir = "clojure";

cliOptions.add(new CliOption(PROJECT_NAME,
"name of the project (Default: generated from info.title or \"swagger-clj-client\")"));
"name of the project (Default: generated from info.title or \"openapi-clj-client\")"));
cliOptions.add(new CliOption(PROJECT_DESCRIPTION,
"description of the project (Default: using info.description or \"Client library of <projectNname>\")"));
cliOptions.add(new CliOption(PROJECT_VERSION,
Expand Down Expand Up @@ -122,7 +122,7 @@ public void preprocessOpenAPI(OpenAPI openAPI) {

// default values
if (projectName == null) {
projectName = "swagger-clj-client";
projectName = "openapi-clj-client";
}
if (projectVersion == null) {
projectVersion = "1.0.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConfig {
private static final String ALL_OPERATIONS = "";
protected String invokerPackage = "io.swagger.client";
protected String groupId = "io.swagger";
protected String artifactId = "swagger-client";
protected String groupId = "org.openapitools";
protected String artifactId = "openapi-client";
protected String artifactVersion = "1.0.0";

public ConfluenceWikiCodegen() {
Expand All @@ -36,8 +36,8 @@ public ConfluenceWikiCodegen() {
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));

additionalProperties.put("appName", "Swagger Sample");
additionalProperties.put("appDescription", "A sample swagger server");
additionalProperties.put("appName", "OpenAPI Sample");
additionalProperties.put("appDescription", "A sample openapi server");
additionalProperties.put("infoUrl", "https://helloreverb.com");
additionalProperties.put("infoEmail", "[email protected]");
additionalProperties.put("licenseInfo", "All rights reserved");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

public class FinchServerCodegen extends DefaultCodegen implements CodegenConfig {
protected String invokerPackage = "io.swagger.client";
protected String groupId = "io.swagger";
protected String groupId = "org.openapitools";
protected String artifactId = "finch-server";
protected String artifactVersion = "1.0.0";
protected String sourceFolder = "src/main/scala";
Expand Down Expand Up @@ -106,10 +106,10 @@ public FinchServerCodegen() {

additionalProperties.put("modelPackage", modelPackage());
additionalProperties.put("apiPackage", apiPackage());
additionalProperties.put("appName", "Swagger Sample");
additionalProperties.put("appDescription", "A sample swagger server");
additionalProperties.put("infoUrl", "http://swagger.io");
additionalProperties.put("infoEmail", "[email protected]");
additionalProperties.put("appName", "OpenAPI Sample");
additionalProperties.put("appDescription", "A sample openapi server");
additionalProperties.put("infoUrl", "http://org.openapitools");
additionalProperties.put("infoEmail", "[email protected]");
additionalProperties.put("licenseInfo", "Apache 2.0");
additionalProperties.put("licenseUrl", "http://apache.org/licenses/LICENSE-2.0.html");
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class GoServerCodegen extends AbstractGoCodegen {

protected String apiVersion = "1.0.0";
protected int serverPort = 8080;
protected String projectName = "swagger-server";
protected String projectName = "openapi-server";
protected String apiPath = "go";

public GoServerCodegen() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public JavaCXFClientCodegen() {

sourceFolder = "src/gen/java";
invokerPackage = "org.openapitools.api";
artifactId = "swagger-jaxrs-client";
artifactId = "openapi-jaxrs-client";
dateLibrary = "legacy"; //TODO: add joda support to all jax-rs

apiPackage = "org.openapitools.api";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package org.openapitools.codegen.languages;

import java.io.File;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.swagger.v3.oas.models.Operation;

import org.openapitools.codegen.*;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.CodegenModel;
import org.openapitools.codegen.CodegenOperation;
import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.languages.features.CXFServerFeatures;
import org.openapitools.codegen.languages.features.GzipTestFeatures;
import org.openapitools.codegen.languages.features.LoggingTestFeatures;
import org.openapitools.codegen.languages.features.UseGenericResponseFeatures;
import io.swagger.v3.oas.models.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.List;
import java.util.Map;

public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, UseGenericResponseFeatures {
Expand Down Expand Up @@ -57,7 +61,7 @@ public JavaCXFServerCodegen() {

supportsInheritance = true;

artifactId = "swagger-cxf-server";
artifactId = "openapi-cxf-server";

outputFolder = "generated-code/JavaJaxRS-CXF";

Expand Down Expand Up @@ -167,7 +171,7 @@ public void processOpts() {
writeOptional(outputFolder, new SupportingFile("server/pom.mustache", "", "pom.xml"));

writeOptional(outputFolder,
new SupportingFile("server/swagger-codegen-ignore.mustache", "", ".openapi-generator-ignore"));
new SupportingFile("server/openapi-generator-ignore.mustache", "", ".openapi-generator-ignore"));

if (this.generateSpringApplication) {
writeOptional(outputFolder, new SupportingFile("server/readme.md", "", "readme.md"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public JavaClientCodegen() {
outputFolder = "generated-code" + File.separator + "java";
embeddedTemplateDir = templateDir = "Java";
invokerPackage = "io.swagger.client";
artifactId = "swagger-java-client";
artifactId = "openapi-java-client";
apiPackage = "io.swagger.client.api";
modelPackage = "io.swagger.client.model";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen {

private static final Logger LOGGER = LoggerFactory.getLogger(JavaInflectorServerCodegen.class);

protected String title = "Swagger Inflector";
protected String title = "OpenAPI Inflector";
protected String implFolder = "src/main/java";

public JavaInflectorServerCodegen() {
Expand All @@ -26,7 +26,7 @@ public JavaInflectorServerCodegen() {
apiTestTemplateFiles.clear(); // TODO: add test template
embeddedTemplateDir = templateDir = "JavaInflector";
invokerPackage = "io.swagger.controllers";
artifactId = "swagger-inflector-server";
artifactId = "openapi-inflector-server";
dateLibrary = "legacy"; //TODO: add joda support

// clear model and api doc template as this codegen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen imp
*/
public JavaJAXRSCXFCDIServerCodegen() {
outputFolder = "generated-code/JavaJaxRS-CXF-CDI";
artifactId = "swagger-jaxrs-cxf-cdi-server";
artifactId = "openapi-jaxrs-cxf-cdi-server";
sourceFolder = "src" + File.separator + "gen" + File.separator + "java";

// Three API templates to support CDI injection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
public JavaJAXRSSpecServerCodegen() {
super();
invokerPackage = "io.swagger.api";
artifactId = "swagger-jaxrs-server";
artifactId = "openapi-jaxrs-server";
outputFolder = "generated-code/JavaJaxRS-Spec";

modelTemplateFiles.put("model.mustache", ".java");
Expand Down Expand Up @@ -94,7 +94,7 @@ public void processOpts() {
}
if (interfaceOnly) {
// Change default artifactId if genereating interfaces only, before command line options are applied in base class.
artifactId = "swagger-jaxrs-client";
artifactId = "openapi-jaxrs-client";
}

super.processOpts();
Expand Down
Loading

0 comments on commit 5340c35

Please sign in to comment.