-
-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build(Test) error on version 2.3.0 with JDK 21 #2442
Comments
Can you Provide a Minimal, Reproducible Example - with HelloController that reproduces the problem ? |
Thank you, @bnasslahsen, for your response. I'm sorry if I wasn't specific enough. I discussed building this project from the source when the testing machine was on the JDK 21.
|
Minimal Reproducible Example
git clone https://github.com/springdoc/springdoc-openapi.git
sdk install maven &&
sdk install java 17.0.10-tem &&
sdk install java 21.0.2-tem
sdk default java 17.0.10-tem &&
mvn test -Dtest=SpringDocApp193Test "-Dsurefire.failIfNoSpecifiedTests=false" > happy_path.log 2>&1
sdk default java 21.0.2-tem &&
mvn test -Dtest=SpringDocApp193Test "-Dsurefire.failIfNoSpecifiedTests=false" > error_path.log 2>&1 LogsTest case (Java 21)Git DiffRunning it under Java 21 will generate more lines in the spec file. {
"components": {
"schemas": {
+ "Book": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ }
+ },
+ "description": "Represents a Book."
+ },
"Books": {
"type": "array",
"description": "Represents a list of Books.",
"properties": {
"empty": {
"type": "boolean"
+ },
+ "first": {
+ "$ref": "#/components/schemas/Book"
+ },
+ "last": {
+ "$ref": "#/components/schemas/Book"
}
}
}
}
}
} |
@bnasslahsen I've just updated my previous answer. The As for the other section of the git diff, shouldn't the Book schema be expected to be included in the response? |
…irst()` and `getLast()`` methods were added to the `java.util.List` interface. Those are the POJO getters, therefore Jackson will add them during serialization. So there are two different expected results for Java prior 21 and starting from Java 21. Fixes springdoc#2442.
@bnasslahsen here is the PR to fix the issue described above. Could you please check it? Thanks in advance! |
SpringDocApp193Test.java fails with JDK 21
Version:
mvn clean package
fails with:Screenshot:
On JDK 17 build passes without a problem.
The text was updated successfully, but these errors were encountered: