"Error-ModelName{namespace='java.lang', name='Void'}" in 3.0.0 springfox + webflux
See original GitHub issueI have Docket configured like that:
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.alternateTypeRules(
newRule(
typeResolver.resolve(List.class, LocalDateTime.class),
typeResolver.resolve(List.class, String.class)
),
newRule(
typeResolver.resolve(List.class, LocalDate.class),
typeResolver.resolve(List.class, String.class)
)
)
.apiInfo(apiInfo)
.securitySchemes(Collections.singletonList(oauth()))
.securityContexts(List.of(securityContext()))
.forCodeGeneration(true)
.directModelSubstitute(java.nio.ByteBuffer.class, String.class)
.genericModelSubstitutes(Mono.class, Flux.class, Publisher.class)
.host(host)
.protocols(protocols)
.select()
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
.paths(regex(swaggerProperties.getDefaultIncludePattern()))
.build();
And have an API method that return Flux<Void>
@PostMapping("refresh")
public Flux<Void> refresh() {
return callsProvider.refresh().subscribeOn(Schedulers.elastic());
}
But in JSON I’ve got an error:
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "Error-ModelName{namespace='java.lang', name='Void'}",
"originalRef": "Error-ModelName{namespace='java.lang', name='Void'}"
}
}
},
Adding .ignoredParameterTypes(Void.class)
to Docket
didn’t help.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Suddenly Springfox Swagger 3.0 is not working with spring ...
This is how it worked for me. I am using InteliJ IDEA, SpringBoot and Maven. When adding Swagger dependencies as: <dependency> <groupId>io.
Read more >Springfox Reference Documentation - GitHub Pages
Springfox works by examining an application, once, at runtime to infer API semantics based on spring configurations, class structure and various ...
Read more >failed to start bean 'documentationpluginsbootstrapper ...
Spring boot Swagger implementation using Spring Fox Failed to start bean ... implementation('io.springfox:springfox-spring-webflux:3.0.0-SNAPSHOT') ...
Read more >springfox-spring-integration-webflux : 3.0.0 - Maven Central
springfox -spring-integration-webflux - JSON API documentation for spring based applications. ... io.springfox:springfox-spring-integration-webflux 3.0.0.
Read more >springfox-swagger2 » 2.10.3 - Maven Repository
io.springfox » springfox-spring-webmvc · 2.10.3 · 3.0.0. Apache 2.0, logo, io.springfox » springfox-spring-webflux · 2.10.3 · 3.0.0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I came across similar issue yesterday. But in my case from what I can see it is related to consuming
multipart/form-data
ie.then I got the same error as in issue title, but JSON was a little bit different:
For now, I have workaround were I explicitly override
200
status code with:EDIT:
While trying to debug the issue I have found the following property:
which fixes the above issue when set to
false
as it does not use open API v3.Maybe it’s not suitable for everyone but a workaround in my case was to remove a redundant
produces
attribute from HTTP method annotations.For example:
Changed to: