springdoc / springdoc-openapi

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
3.29k stars 499 forks source link

Can't find bean of type SpringDocDataRestConfiguration.SpringRepositoryRestResourceProviderConfiguration #2014

Closed shovelmn12 closed 1 year ago

shovelmn12 commented 1 year ago

Describe the bug

When added springdoc v2 to spring-boot v3 and loading up the app I get the following exception:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 3 of method dataRestRequestBuilder in org.springdoc.core.configuration.SpringDocDataRestConfiguration$SpringRepositoryRestResourceProviderConfiguration required a bean of type 'org.springdoc.core.service.AbstractRequestService' that could not be found.

Action:

Consider defining a bean of type 'org.springdoc.core.service.AbstractRequestService' in your configuration.

I tried adding a @Bean for SpringRepositoryRestResourceProviderConfiguration but that class is private.

Expected behavior

Loading up the app with open-api endpoint

Additional context

pom.xml ``` 4.0.0 com.project project Project 1.0.0 jar 17 17 UTF-8 UTF-8 ${project.basedir}/drivers pre-integration-test 2.10 11.2.1.jre8 1.4.5 1.7.22 1.4.1 org.springframework.boot spring-boot-starter-parent 3.0.0 central https://repo.maven.apache.org/maven2 false central https://repo.maven.apache.org/maven2 false org.springframework.boot spring-boot-starter-jdbc jakarta.validation jakarta.validation-api 3.0.2 jakarta.persistence jakarta.persistence-api 3.1.0 com.google.code.gson gson ${gson.version} org.springframework.boot spring-boot-configuration-processor true com.microsoft.sqlserver mssql-jdbc ${mssql-jdbc.version} com.h2database h2 runtime org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-devtools true org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-starter-data-rest org.springdoc springdoc-openapi-starter-common 2.0.2 javax.xml.parsers jaxp-api ${jaxp-api.version} org.apache.httpcomponents httpclient org.jetbrains.kotlin kotlin-test ${kotlin.version} test org.jetbrains.kotlin kotlin-stdlib-jdk8 ${kotlin.version} org.jetbrains.kotlin kotlin-reflect ${kotlin.version} runtime org.jetbrains.kotlinx kotlinx-serialization-json ${serialization.version} org.springframework.boot spring-boot-starter-validation ${project.basedir}/src/main/kotlin ${project.basedir}/src/test spring-boot:run org.jetbrains.kotlin kotlin-maven-plugin ${kotlin.version} -Xjsr305=strict spring jpa no-arg ${java.version} org.jetbrains.kotlin kotlin-maven-allopen ${kotlin.version} org.jetbrains.kotlin kotlin-maven-noarg ${kotlin.version} compile process-sources compile org.springframework.boot spring-boot-maven-plugin org.springframework.boot.experimental spring-boot-thin-layout ${spring-boot-thin-layout.version} repackage build-info true production org.springframework.boot spring-boot-maven-plugin integration-tests org.springframework.boot spring-boot-maven-plugin start-spring-boot pre-integration-test start stop-spring-boot post-integration-test stop src/main/resources ```
bnasslahsen commented 1 year ago

@shovelmn12,

Depending on your usecase, either use webflux or webmvc starters that ships the springdoc-openapi-starter-common

See demos code for more details: https://github.com/springdoc/springdoc-openapi-demos/blob/2.x/demo-spring-data-rest/pom.xml