Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #3300 – TYPE_USE annotations on `@ParameterObject` fields are not passed along
- #3341 – Stabilize Spring Data `Sort` and `Pageable` schema property order
- #3338 – Kotlin nullability interpretation of the `Any?` type
- #3332 – The properties a Kotlin entity inherits from an `@Embeddable` are missing from the Spring Data REST schemas

## [2.9.0] - 2026-07-31

Expand Down
1 change: 1 addition & 0 deletions springdoc-openapi-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<module>springdoc-openapi-actuator-webmvc-tests</module>
<module>springdoc-openapi-kotlin-webflux-tests</module>
<module>springdoc-openapi-kotlin-webmvc-tests</module>
<module>springdoc-openapi-kotlin-data-rest-tests</module>
<module>springdoc-openapi-hateoas-tests</module>
<module>springdoc-openapi-data-rest-tests</module>
</modules>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
######################
# Project Specific
######################
/target/www/**
/src/test/javascript/coverage/

######################
# Node
######################
/node/
node_tmp/
node_modules/
npm-debug.log.*
/.awcache/*
/.cache-loader/*

######################
# SASS
######################
.sass-cache/

######################
# Eclipse
######################
*.pydevproject
.project
.metadata
tmp/
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
.factorypath
/src/main/resources/rebel.xml

# External tool builders
.externalToolBuilders/**

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath

######################
# Intellij
######################
.idea/
*.iml
*.iws
*.ipr
*.ids
*.orig
classes/
out/

######################
# Visual Studio Code
######################
.vscode/

######################
# Maven
######################
/log/
/target/

######################
# Gradle
######################
.gradle/
/build/

######################
# Package Files
######################
*.jar
*.war
*.ear
*.db

######################
# Windows
######################
# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini

######################
# Mac OSX
######################
.DS_Store
.svn

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

######################
# Directories
######################
/bin/
/deploy/

######################
# Logs
######################
*.log*

######################
# Others
######################
*.class
*.*~
*~
.merge_file*

######################
# Gradle Wrapper
######################
!gradle/wrapper/gradle-wrapper.jar

######################
# Maven Wrapper
######################
!.mvn/wrapper/maven-wrapper.jar

######################
# ESLint
######################
.eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>springdoc-openapi-tests</artifactId>
<groupId>org.springdoc</groupId>
<version>2.9.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>springdoc-openapi-kotlin-data-rest-tests</artifactId>
<name>${project.artifactId}</name>

<dependencies>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
<configuration>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
<args>
<arg>-java-parameters
</arg> <!-- Get correct parameter names in jqwik reporting -->
<arg>-Xemit-jvm-type-annotations
</arg> <!-- Enable annotations on type variables -->
</args>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<!-- Replacing default-compile as it is treated specially by Maven -->
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<!-- Replacing default-testCompile as it is treated specially by Maven -->
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
<execution>
<id>java-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>java-test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package test.org.springdoc.api.v31

import org.junit.jupiter.api.Test
import org.skyscreamer.jsonassert.JSONAssert
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
import org.springframework.test.web.servlet.result.MockMvcResultMatchers
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.nio.file.Paths

@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("test")
abstract class AbstractKotlinDataRestTest {

@Autowired
val mockMvc: MockMvc? = null

private val logger = LoggerFactory.getLogger(AbstractKotlinDataRestTest::class.java)

@Test
fun testApp() {
var result: String? = null
try {
val response = mockMvc!!.perform(MockMvcRequestBuilders.get("/v3/api-docs"))
.andExpect(MockMvcResultMatchers.status().isOk).andReturn()

result = response.response.contentAsString
val className = javaClass.simpleName
val testNumber = className.replace("[^0-9]".toRegex(), "")

val expected = getContent("results/3.1.0/app$testNumber.json")
JSONAssert.assertEquals(expected, result, true)
} catch (e: AssertionError) {
logger.error(result)
throw e
}
}

companion object {
fun getContent(fileName: String): String {
val path = Paths.get(
AbstractKotlinDataRestTest::class.java.classLoader.getResource(fileName)!!.toURI()
)
return String(Files.readAllBytes(path), StandardCharsets.UTF_8)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package test.org.springdoc.api.v31.app1

import jakarta.persistence.Embeddable
import jakarta.persistence.Embedded
import jakarta.persistence.Entity
import jakarta.persistence.Id

@Entity
class Person {

@Id
var id: Long? = null

@Embedded
var name: Name? = null
}

@Embeddable
class Name {

var firstName: String? = null

var lastName: String? = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package test.org.springdoc.api.v31.app1

import org.springframework.data.repository.PagingAndSortingRepository
import org.springframework.data.rest.core.annotation.RepositoryRestResource

@RepositoryRestResource(collectionResourceRel = "people", path = "people")
interface PersonRepository : PagingAndSortingRepository<Person, Long>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package test.org.springdoc.api.v31.app1

import org.springframework.boot.autoconfigure.SpringBootApplication
import test.org.springdoc.api.v31.AbstractKotlinDataRestTest

/**
* The properties an entity inherits from a Kotlin `@Embeddable` have to be described,
* see https://github.com/springdoc/springdoc-openapi/issues/3332
*/
class SpringDocApp1Test : AbstractKotlinDataRestTest() {

@SpringBootApplication
class SpringDocTestApp
}
Loading
Loading