I utilized Springdocs 1 in Springboot 2 to generate my Swagger documentation. In addition, I employed the springdoc-openapi-data-rest library to generate the additional parameters necessary for @QuerydslPredicate instead of using the predicate object.
This was the dependency I was using with Springboot 2.
<dependency>
<!-- required swagger documentation of QueryDSL predicates -->
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-data-rest</artifactId>
<version>1.6.15</version>
</dependency>
Since I have upgraded to Springboot 3 and Springdoc 2, the swagger documentation for these parmeters are no longer being generated.
I now get:
My controller looks like this:
@RequiredArgsConstructor
@RestController
public class BookController {
private final BookRepository bookRepository;
@GetMapping("/books")
@Operation(description = "Find all books.")
public Iterable<Book> getBooks(@QuerydslPredicate(root = Book.class, bindings = BookRepository.class) Predicate predicate) {
return bookRepository.findAll(predicate);
}
}
According to the Springdoc documentation, all I need to do is add springdoc-openapi-starter-webmvc-api
I have a minimal viable project on Github.
How do I make the project generate the parmeters for Book (id, name, bookNumber and otherField) as Springboot 2 and springdoc-openapi-data-rest did.