diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml
index 3fbafa1d09b..ab9282eb666 100644
--- a/.github/workflows/samples-kotlin-server.yaml
+++ b/.github/workflows/samples-kotlin-server.yaml
@@ -3,9 +3,11 @@ name: Samples Kotlin server
on:
push:
branches:
+ - samples/server/others/kotlin-server/jaxrs-spec/**
- 'samples/server/petstore/kotlin*/**'
pull_request:
paths:
+ - samples/server/others/kotlin-server/jaxrs-spec/**
- 'samples/server/petstore/kotlin*/**'
env:
@@ -31,6 +33,7 @@ jobs:
- samples/server/petstore/kotlin-server/jaxrs-spec
- samples/server/petstore/kotlin-server/jaxrs-spec-mutiny
- samples/server/petstore/kotlin-server-modelMutable
+ - samples/server/others/kotlin-server/jaxrs-spec
# no build.gradle file
#- samples/server/petstore/kotlin-vertx-modelMutable
steps:
diff --git a/bin/configs/kotlin-server-jaxrs-spec-parameter-tests.yaml b/bin/configs/kotlin-server-jaxrs-spec-parameter-tests.yaml
new file mode 100644
index 00000000000..948d739d995
--- /dev/null
+++ b/bin/configs/kotlin-server-jaxrs-spec-parameter-tests.yaml
@@ -0,0 +1,7 @@
+generatorName: kotlin-server
+outputDir: samples/server/others/kotlin-server/jaxrs-spec
+library: jaxrs-spec
+inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-server
+additionalProperties:
+ useCoroutines: "true"
diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache
index a4e38d62d12..2a933154fc8 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache
@@ -1 +1 @@
-{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isCookieParam}}
\ No newline at end of file
+{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue({{{.}}}){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isCookieParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache
index fae6f993787..e5b328fa200 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache
@@ -1 +1 @@
-{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isHeaderParam}}
\ No newline at end of file
+{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue({{{.}}}){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isHeaderParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache
index 8031a4a6fc2..8148b70d6c2 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache
@@ -1 +1 @@
-{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isPathParam}}
\ No newline at end of file
+{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isPathParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache
index c32380dfe87..d6468ba1d7c 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache
@@ -1 +1 @@
-{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isQueryParam}}
\ No newline at end of file
+{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue({{{.}}}){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isQueryParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml b/modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
new file mode 100644
index 00000000000..364f7f5da74
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
@@ -0,0 +1,76 @@
+openapi: 3.0.0
+info:
+ description: test parameters
+ version: 1.0.0
+ title: Test parameters
+ license:
+ name: Apache-2.0
+ url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
+paths:
+ /test/parameters/{path_default}/{path_nullable}:
+ get:
+ tags:
+ - default
+ summary: Finds Pets by status
+ description: Multiple status values can be provided with comma separated strings
+ operationId: findPetsByStatus
+ parameters:
+ - name: query_default
+ in: query
+ description: query default
+ style: form
+ explode: false
+ deprecated: true
+ schema:
+ type: string
+ default: available
+ - name: header_default
+ in: header
+ description: header default
+ schema:
+ type: string
+ default: available
+ - name: path_default
+ in: path
+ description: path default
+ required: true
+ schema:
+ type: string
+ - name: cookie_default
+ in: cookie
+ description: cookie default
+ schema:
+ type: string
+ default: available
+ - name: query_nullable
+ in: query
+ description: query nullable
+ style: form
+ explode: false
+ deprecated: true
+ schema:
+ type: string
+ nullable: true
+ - name: header_nullable
+ in: header
+ description: header nullable
+ schema:
+ type: string
+ nullable: true
+ - name: path_nullable
+ in: path
+ required: true
+ description: path_nullable
+ schema:
+ type: string
+ - name: cookie_nullable
+ in: cookie
+ description: cookie_nullable
+ schema:
+ nullable: true
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ '400':
+ description: Invalid status value
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator-ignore b/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator/FILES b/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator/FILES
new file mode 100644
index 00000000000..ca40206f369
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator/FILES
@@ -0,0 +1,5 @@
+README.md
+build.gradle
+gradle.properties
+settings.gradle
+src/main/kotlin/org/openapitools/server/apis/DefaultApi.kt
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator/VERSION b/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator/VERSION
new file mode 100644
index 00000000000..757e6740040
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.0.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/README.md b/samples/server/others/kotlin-server/jaxrs-spec/README.md
new file mode 100644
index 00000000000..76d6aede102
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/README.md
@@ -0,0 +1,49 @@
+# org.openapitools.server - Kotlin Server library for Test parameters
+
+## Requires
+
+* Kotlin 1.4.31
+* Gradle 6.8.2
+
+## Build
+
+First, create the gradle wrapper script:
+
+```
+gradle wrapper
+```
+
+Then, run:
+
+```
+./gradlew check assemble
+```
+
+This runs all tests and packages the library.
+
+## Features/Implementation Notes
+
+* Supports JSON inputs/outputs, File inputs, and Form inputs.
+* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
+* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
+
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://localhost*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*DefaultApi* | [**findPetsByStatus**](docs/DefaultApi.md#findpetsbystatus) | **GET** /test/parameters/{path_default}/{path_nullable} | Finds Pets by status
+
+
+
+## Documentation for Models
+
+
+
+
+## Documentation for Authorization
+
+Endpoints do not require authorization.
+
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/build.gradle b/samples/server/others/kotlin-server/jaxrs-spec/build.gradle
new file mode 100644
index 00000000000..08b7d334129
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/build.gradle
@@ -0,0 +1,51 @@
+group "org.openapitools"
+version "1.0.0"
+
+wrapper {
+ gradleVersion = "6.9"
+ distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
+}
+
+buildscript {
+ ext.kotlin_version = "1.7.20"
+ ext.swagger_annotations_version = "1.5.3"
+ ext.jakarta_annotations_version = "1.3.5"
+ ext.jakarta_ws_rs_version = "2.1.6"
+ ext.jackson_version = "2.9.9"
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ maven { url "https://plugins.gradle.org/m2/" }
+ }
+ dependencies {
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
+ }
+}
+
+apply plugin: "java"
+apply plugin: "kotlin"
+apply plugin: "application"
+
+sourceCompatibility = 1.8
+
+compileKotlin {
+ kotlinOptions.jvmTarget = "1.8"
+}
+
+compileTestKotlin {
+ kotlinOptions.jvmTarget = "1.8"
+}
+
+repositories {
+ maven { setUrl("https://repo1.maven.org/maven2") }
+}
+
+dependencies {
+ implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
+ implementation("ch.qos.logback:logback-classic:1.2.1")
+ implementation("jakarta.ws.rs:jakarta.ws.rs-api:$jakarta_ws_rs_version")
+ implementation("jakarta.annotation:jakarta.annotation-api:$jakarta_annotations_version")
+ implementation("io.swagger:swagger-annotations:$swagger_annotations_version")
+ implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version")
+ implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version")
+ testImplementation("junit:junit:4.13.2")
+}
\ No newline at end of file
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/gradle.properties b/samples/server/others/kotlin-server/jaxrs-spec/gradle.properties
new file mode 100644
index 00000000000..5f1ed7bbe02
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/gradle.properties
@@ -0,0 +1 @@
+org.gradle.caching=true
\ No newline at end of file
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/settings.gradle b/samples/server/others/kotlin-server/jaxrs-spec/settings.gradle
new file mode 100644
index 00000000000..a09a58efab1
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'kotlin-server'
\ No newline at end of file
diff --git a/samples/server/others/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/DefaultApi.kt b/samples/server/others/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/DefaultApi.kt
new file mode 100644
index 00000000000..c448f38e266
--- /dev/null
+++ b/samples/server/others/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/DefaultApi.kt
@@ -0,0 +1,20 @@
+package org.openapitools.server.apis;
+
+
+import javax.ws.rs.*
+import javax.ws.rs.core.Response
+
+
+import java.io.InputStream
+
+
+
+@Path("/")
+@javax.annotation.Generated(value = arrayOf("org.openapitools.codegen.languages.KotlinServerCodegen"))
+class DefaultApi {
+
+ @GET
+ suspend fun findPetsByStatus(@PathParam("path_default") pathDefault: kotlin.String,@PathParam("path_nullable") pathNullable: kotlin.String,@QueryParam("query_default") @DefaultValue("available") queryDefault: kotlin.String,@HeaderParam("header_default") @DefaultValue("available") headerDefault: kotlin.String,@CookieParam("cookie_default") @DefaultValue("available") cookieDefault: kotlin.String,@QueryParam("query_nullable") queryNullable: kotlin.String?,@HeaderParam("header_nullable") headerNullable: kotlin.String?,@CookieParam("cookie_nullable") cookieNullable: kotlin.String?): Response {
+ return Response.ok().entity("magic!").build();
+ }
+}