Skip to content

Commit

Permalink
Update Groovy default value, fix import error when doing "gradle test" (
Browse files Browse the repository at this point in the history
#203)

* update groovy default value, fix import error when doing gradle test

* remove empty lines
  • Loading branch information
wing328 authored Apr 23, 2018
1 parent 16589de commit b908b73
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 742 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,6 @@ cabal.project.local
samples/client/petstore/elixir/_build/
samples/client/petstore/elixir/deps/
samples/client/petstore/elixir/mix.lock

# groovy
samples/client/petstore/groovy/build
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
public GroovyClientCodegen() {
super();

// clear import mapping (from default generator) as groovy does not use it
// at the moment
importMapping.clear();
// avoid importing the following as models
languageSpecificPrimitives.add("Date");
languageSpecificPrimitives.add("ArrayList");
languageSpecificPrimitives.add("File");
languageSpecificPrimitives.add("Map");

sourceFolder = projectFolder + File.separator + "groovy";
outputFolder = "generated-code/groovy";
Expand All @@ -29,18 +31,17 @@ public GroovyClientCodegen() {
modelDocTemplateFiles.remove("model_doc.mustache");
apiDocTemplateFiles.remove("api_doc.mustache");

apiPackage = "io.swagger.api";
modelPackage = "io.swagger.model";
configPackage = "io.swagger.configuration";
invokerPackage = "io.swagger.api";
artifactId = "swagger-groovy";
apiPackage = "org.openapitools.api";
modelPackage = "org.openapitools.model";
configPackage = "org.openapitools.configuration";
invokerPackage = "org.openapitools.api";
artifactId = "openapi-groovy";
dateLibrary = "legacy"; //TODO: add joda support to groovy

additionalProperties.put("title", title);
additionalProperties.put(CONFIG_PACKAGE, configPackage);

cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code"));

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ class {{classname}} {
{{/vars}}
}
{{/model}}
{{/models}}
{{/models}}
2 changes: 1 addition & 1 deletion samples/client/petstore/groovy/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.3-SNAPSHOT
3.0.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.swagger.api;
package org.openapitools.api;

import groovyx.net.http.HTTPBuilder
import groovyx.net.http.Method
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package io.swagger.api;
package org.openapitools.api;

import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
import io.swagger.api.ApiUtils
import org.openapitools.api.ApiUtils

import io.swagger.model.File
import io.swagger.model.ModelApiResponse
import io.swagger.model.Pet
import org.openapitools.model.ModelApiResponse
import org.openapitools.model.Pet

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package io.swagger.api;
package org.openapitools.api;

import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
import io.swagger.api.ApiUtils
import org.openapitools.api.ApiUtils

import io.swagger.model.Map
import io.swagger.model.Order
import org.openapitools.model.Order

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.swagger.api;
package org.openapitools.api;

import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
import io.swagger.api.ApiUtils
import org.openapitools.api.ApiUtils

import io.swagger.model.User
import org.openapitools.model.User

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.swagger.model;
package org.openapitools.model;

import groovy.transform.Canonical
import io.swagger.annotations.ApiModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.swagger.model;
package org.openapitools.model;

import groovy.transform.Canonical
import io.swagger.annotations.ApiModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package io.swagger.model;
package org.openapitools.model;

import groovy.transform.Canonical
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.Date;

@Canonical
class Order {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.swagger.model;
package org.openapitools.model;

import groovy.transform.Canonical
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.ArrayList;
import io.swagger.model.Category;
import io.swagger.model.Tag;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.model.Category;
import org.openapitools.model.Tag;

@Canonical
class Pet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.swagger.model;
package org.openapitools.model;

import groovy.transform.Canonical
import io.swagger.annotations.ApiModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.swagger.model;
package org.openapitools.model;

import groovy.transform.Canonical
import io.swagger.annotations.ApiModel;
Expand Down

This file was deleted.

Loading

0 comments on commit b908b73

Please sign in to comment.