WDAqua / Qanary

Qanary a methodology to construct and share resources to build QA systems
55 stars 25 forks source link

[Snyk] Upgrade org.springdoc:springdoc-openapi-data-rest from 1.7.0 to 1.8.0 #287

Open anbo-de opened 3 months ago

anbo-de commented 3 months ago

This PR was automatically created by Snyk using the credentials of a real user.


![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)

Snyk has created this PR to upgrade org.springdoc:springdoc-openapi-data-rest from 1.7.0 to 1.8.0.

:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
- The recommended version is **1 version** ahead of your current version. - The recommended version was released on **3 months ago**. --- > [!IMPORTANT] > > - Check the changes in this PR to ensure they won't cause issues with your project. > - This PR was automatically created by Snyk using the credentials of a real user. --- **Note:** _You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs._ **For more information:** > - 🧐 [View latest project report](https://app.snyk.io/org/anbo-de/project/ee44bfa2-9c74-4e6d-bbb8-fa23594b6bd0?utm_source=github&utm_medium=referral&page=upgrade-pr) > - 📜 [Customise PR templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates) > - 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/anbo-de/project/ee44bfa2-9c74-4e6d-bbb8-fa23594b6bd0/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) > - 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/anbo-de/project/ee44bfa2-9c74-4e6d-bbb8-fa23594b6bd0/settings/integration?pkg=org.springdoc:springdoc-openapi-data-rest&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades)
heinpa commented 1 month ago

Error after upgrading to springdoc v1.8.0:

[ERROR] testOpenApiDefinitionAvailability  Time elapsed: 0.279 s  <<< ERROR!
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'boolean io.swagger.v3.oas.annotations.parameters.RequestBody.useParameterTypeSchema()'
    at eu.wdaqua.qanary.QanaryQuestionAnsweringControllerTest.testOpenApiDefinitionAvailability(QanaryQuestionAnsweringControllerTest.java:154)
Caused by: java.lang.NoSuchMethodError: 'boolean io.swagger.v3.oas.annotations.parameters.RequestBody.useParameterTypeSchema()'
    at eu.wdaqua.qanary.QanaryQuestionAnsweringControllerTest.testOpenApiDefinitionAvailability(QanaryQuestionAnsweringControllerTest.java:154)

=> apparently missing method io.swagger.v3.oas.annotations.parameters.RequestBody.useParameterTypeSchema()

Checking swagger-core versions with mvn dependency:tree:

for 1.7.0

[INFO] +- org.springdoc:springdoc-openapi-data-rest:jar:1.7.0:compile
[INFO] |  +- org.springdoc:springdoc-openapi-hateoas:jar:1.7.0:compile
[INFO] |  |  +- org.springdoc:springdoc-openapi-common:jar:1.7.0:compile
[INFO] |  |  |  \- io.swagger.core.v3:swagger-core:jar:2.2.9:compile

[INFO] +- io.swagger.core.v3:swagger-core-jakarta:jar:2.2.22:compile

for 1.8.0

[INFO] +- org.springdoc:springdoc-openapi-data-rest:jar:1.8.0:compile
[INFO] |  +- org.springdoc:springdoc-openapi-hateoas:jar:1.8.0:compile
[INFO] |  |  +- org.springdoc:springdoc-openapi-common:jar:1.8.0:compile
[INFO] |  |  |  \- io.swagger.core.v3:swagger-core:jar:2.2.20:compile

[INFO] +- io.swagger.core.v3:swagger-core-jakarta:jar:2.2.22:compile

Side-Note: we exclude io.swagger.core.v3:swagger-annotations from openapi dependencies.

Swagger v2.2.9 does not have a method useParameterTypeSchema() (see docs for v2.2.9), but v2.2.22 does (see docs for v2.2.22 )

heinpa commented 1 month ago

solutions for this might also be helpful for #295