springdoc-openapi-demos
springdoc-openapi-demos copied to clipboard
openapi3 integration with webflux functional way is not working
I am trying to integrate openapi3 with reactive webflux functional endpoints. but i am always getting the error message "invalid version" from andother route configuration.andOther(route(RequestPredicates.all(), errorHandler::invalidVersion))
. If i remove that validation swagger is working but the version validation is failing.below is my custom router.
route()
.add((RouterFunction<ServerResponse>) routerFunctionMappings
.stream()
.map(routemapping -> Tuples.of(routemapping.getVersion(),
routeForVersion(routemapping.getRouteMapping())))
.reduce(Tuples.of("test", route()), (tupel2RouteFunction1, tupel2RouteFunction2) ->
Tuples.of("test", tupel2RouteFunction1
.getT2()
.path(
tupel2RouteFunction2.getT1(),
() -> (RouterFunction<ServerResponse>) tupel2RouteFunction2
.getT2()
.build()
.andOther(
route(RequestPredicates.all(), handler::validate)))))
.getT2()
.build()
.andOther(route(RequestPredicates.all(), errorHandler::invalidVersion)))
.build()
.filter(filterFunction());
Please help me how to resolve this to make both validation and swagger works.
I found the solution. this got resolved when i updated this line.andOther(route(RequestPredicates.all(), errorHandler::invalidVersion))
to .andOther(route(RequestPredicates .pathPredicates(PathPatternParser.defaultInstance) .apply("/swagger-doc/**").negate(), errorHandler::versionNotSupported))