forked from loafle/openapi-generator-original
Test kotlin-json-request-date in CI (#4824)
* test kotlin-json-request-date in ci * minor code formatting * add pom.xml for testing * fix permission
This commit is contained in:
@@ -238,9 +238,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
||||
}
|
||||
|
||||
private void processRequestDateConverter() {
|
||||
if(RequestDateConverter.TO_JSON.value.equals(requestDateConverter)) {
|
||||
if (RequestDateConverter.TO_JSON.value.equals(requestDateConverter)) {
|
||||
additionalProperties.put(RequestDateConverter.TO_JSON.value, true);
|
||||
} else if(RequestDateConverter.TO_STRING.value.equals(requestDateConverter)) {
|
||||
} else if (RequestDateConverter.TO_STRING.value.equals(requestDateConverter)) {
|
||||
additionalProperties.put(RequestDateConverter.TO_STRING.value, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
|
||||
super.processOpts();
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
|
||||
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
|
||||
this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
|
||||
}
|
||||
|
||||
// set default library to "ktor"
|
||||
@@ -185,7 +185,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen {
|
||||
additionalProperties.put(Constants.COMPRESSION, getCompressionFeatureEnabled());
|
||||
}
|
||||
|
||||
boolean generateApis = additionalProperties.containsKey(CodegenConstants.GENERATE_APIS) && (Boolean)additionalProperties.get(CodegenConstants.GENERATE_APIS);
|
||||
boolean generateApis = additionalProperties.containsKey(CodegenConstants.GENERATE_APIS) && (Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS);
|
||||
String packageFolder = (sourceFolder + File.separator + packageName).replace(".", File.separator);
|
||||
String resourcesFolder = "src/main/resources"; // not sure this can be user configurable.
|
||||
|
||||
|
||||
@@ -639,7 +639,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
|
||||
@Override
|
||||
public String toModelName(final String name) {
|
||||
// Allow for explicitly configured spring.*
|
||||
if (name.startsWith("org.springframework.") ) {
|
||||
if (name.startsWith("org.springframework.")) {
|
||||
return name;
|
||||
}
|
||||
return super.toModelName(name);
|
||||
|
||||
1
pom.xml
1
pom.xml
@@ -1260,6 +1260,7 @@
|
||||
<module>samples/client/petstore/kotlin-threetenbp/</module>
|
||||
<module>samples/client/petstore/kotlin-string/</module>
|
||||
<module>samples/client/petstore/kotlin-moshi-codegen/</module>
|
||||
<module>samples/client/petstore/kotlin-json-request-date/</module>
|
||||
<!-- servers -->
|
||||
<module>samples/server/petstore/erlang-server</module>
|
||||
<module>samples/server/petstore/jaxrs/jersey2</module>
|
||||
|
||||
46
samples/client/petstore/kotlin-json-request-date/pom.xml
Normal file
46
samples/client/petstore/kotlin-json-request-date/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>KotlinJsonRequestDateClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Kotlin Moshi Petstore Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>gradle</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
Reference in New Issue
Block a user