Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ad798de
break tests by introducing problematic dollar
Picazsoo Nov 26, 2025
b25bb65
break everything by more defaults and dollars and double quotes
Picazsoo Nov 27, 2025
4c6e186
break everything even more
Picazsoo Nov 27, 2025
b4f370d
break everything consistently to make CR easier
Picazsoo Nov 27, 2025
884975a
fix as much as possible
Picazsoo Nov 27, 2025
8f207b5
fix more places
Picazsoo Nov 27, 2025
319c55d
remove files
Picazsoo Nov 27, 2025
b41dc70
removed some files
Picazsoo Nov 27, 2025
907f878
fix one more place
Picazsoo Nov 27, 2025
c9ce225
DRY tests
Picazsoo Nov 27, 2025
a86a9f1
add unit test
Picazsoo Nov 27, 2025
5485eab
improve unit test
Picazsoo Nov 27, 2025
b89a2f1
add dollar escaping for multiline strings
Picazsoo Nov 27, 2025
d2e3ba1
add dollar escaping for multiline strings and test
Picazsoo Nov 27, 2025
9622ddd
add more compilation tests and extend some current compilations to al…
Picazsoo Nov 27, 2025
8b838c6
fix compilation error
Picazsoo Nov 27, 2025
baefe50
fix one more place
Picazsoo Nov 27, 2025
acce9f3
fix incorrect test assert after fixing api spec "required" attribute
Picazsoo Nov 27, 2025
6def290
try disabling tests
Picazsoo Nov 27, 2025
378250c
comment out the tests to disable them
Picazsoo Nov 27, 2025
f4a1cc5
fix tests on linux
Picazsoo Nov 27, 2025
c350638
also add compile tests for interface_only to show multiline dollar es…
Picazsoo Nov 27, 2025
bd6c1ef
fix samples up to date
Picazsoo Nov 28, 2025
da86be4
fix samples up to date
Picazsoo Nov 28, 2025
7a65094
fix javadoc
Picazsoo Nov 28, 2025
f6692f4
update samples
Picazsoo Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/samples-kotlin-server-jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- samples/server/petstore/kotlin-springboot-3
- samples/server/petstore/kotlin-springboot-3-no-response-entity
- samples/server/petstore/kotlin-springboot-3-dollar-issue-swagger2
- samples/server/petstore/kotlin-springboot-3-dollar-issue-swagger2-interface-only
- samples/server/petstore/kotlin-springboot-additionalproperties
- samples/server/petstore/kotlin-springboot-delegate-nodefaults
- samples/server/petstore/kotlin-springboot-request-cookie
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
generatorName: kotlin-spring
outputDir: samples/server/petstore/kotlin-springboot-3-dollar-issue-swagger2-interface-only
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-dollars.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
additionalProperties:
documentationProvider: springDoc
annotationLibrary: swagger2
useSwaggerUI: "false"
interfaceOnly: "true"
serializableModel: "true"
beanValidations: "true"
useSpringBoot3: "true"
requestMappingMode: api_interface
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.openapi-generator-ignore
README.md
build.gradle.kts
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
pom.xml
settings.gradle
src/main/kotlin/org/openapitools/SpringDocConfiguration.kt
src/main/kotlin/org/openapitools/api/ApiUtil.kt
src/main/kotlin/org/openapitools/api/Exceptions.kt
src/main/kotlin/org/openapitools/api/ItemsApi.kt
src/main/kotlin/org/openapitools/api/PetApi.kt
src/main/kotlin/org/openapitools/api/StoreApi.kt
src/main/kotlin/org/openapitools/api/UserApi.kt
src/main/kotlin/org/openapitools/model/Category.kt
src/main/kotlin/org/openapitools/model/ItemWithDollarAttributesAndExamples.kt
src/main/kotlin/org/openapitools/model/ItemsItemIdSomethingItemSubIdGet200Response.kt
src/main/kotlin/org/openapitools/model/ItemsItemIdSomethingItemSubIdGet200ResponseDetailsInfo.kt
src/main/kotlin/org/openapitools/model/ModelApiResponse.kt
src/main/kotlin/org/openapitools/model/Order.kt
src/main/kotlin/org/openapitools/model/Pet.kt
src/main/kotlin/org/openapitools/model/Tag.kt
src/main/kotlin/org/openapitools/model/User.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.18.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# openAPIPetstore

This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator).

## Getting Started

This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in.

By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl).

To build the project using maven, run:
```bash
mvn package && java -jar target/openapi-spring-1.0.0.jar
```

To build the project using gradle, run:
```bash
gradle build && java -jar build/libs/openapi-spring-1.0.0.jar
```

If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/)
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "org.openapitools"
version = "1.0.0"
java.sourceCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
maven { url = uri("https://repo.spring.io/milestone") }
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}

tasks.bootJar {
enabled = false
}

plugins {
val kotlinVersion = "1.9.25"
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion
id("org.springframework.boot") version "3.0.2"
id("io.spring.dependency-management") version "1.0.14.RELEASE"
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-api:2.6.0")

implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("jakarta.validation:jakarta.validation-api")
implementation("jakarta.annotation:jakarta.annotation-api:2.1.0")

testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(module = "junit")
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading