我有一个小型的Spring微服务,它使用webflux将其端点公开为反应性的。
当我从IntelliJ、Gradle或cmd行运行应用程序时,SpringDoc支持:
implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.4.4'
我去http://localhost:8080/swagger-ui.html,我得到了一个500个错误,日志显示:
java.lang.IllegalStateException: No primary or default constructor found for interf
我正在使用'org.springdoc:springdoc-openapi-webflux-ui:1.2.28'库在我的spring-boot应用程序中显示swagger UI文档。不工作,它返回:
Whitelabel Error Page
This application has no configured error view, so you are seeing this as a fallback.
Fri Jan 24 11:31:02 UTC 2020
[b0282788] There was an unexpected error (type=Not Foun
目前,我正在从事一个使用spring功能web编程的项目。我通常在restController中使用swagger 2的注解,但是用函数式的web编程,我找不到哪里!告诉应用程序搜索端点(比如目录中的basepackage )并在html页面中加载swagger的位置。这是我的代码:
@Configuration
public class RouterClient{
@Bean
public RouterFunction<ServerResponse> routes(ClientHandler client){
return route(GET("/api/clien
当我使用org.springdoc:springdoc-openapi-spring-boot-2-webflux:3.1.5构建reactive时。
我发现了以下错误:
Caused by: java.time.format.DateTimeParseException: Text '2021-03-24' could not be parsed at index 4
样本代码:
Controller
@RestController
public class Controller {
@GetMapping(path = "/test")
public
在蛇案例中没有显示属性。我用的是下面的秘密
implementation group: 'org.springdoc', name: 'springdoc-openapi-webflux-ui', version: '1.6.5'
@OpenAPIDefinition(info = @Info(title = "Samples API", version = "1",
description = "This is a sample api with Open API"),
我在我的Spring应用程序中注意到,映射与MVC不同。
在MVC中,我可以添加一个RestController("/prefix"),以便我的方法都以/prefix为前缀。但在WebFlux,这是行不通的。
这是故意的吗?
注意-我交换了Mono<>返回类型,以查看它是否产生了影响,以防在这里进行其他反省。
例如,这是控制器-
@RestController("/api/user")
public class UserController {
private UserService service;
public UserCon
我为java SpringBoot RESTful应用程序使用springdoc-openapi进行了以下定义:
@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.components(new Components().addSecuritySchemes("bearer-jwt",
new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("
我有以下代码,并且一直收到404 not found错误?任何建议都将不胜感激!
我研究了冲突的依赖关系,这似乎不是问题所在。我还确保返回了正确的内容类型。
有一件事我不确定我做得是否正确,那就是用Bean和Autowired注解。我不太理解他们现在在做什么。
下面的路由器类别
@Configuration
@AllArgsConstructor
public class AgencyRouter {
@Bean
public RouterFunction<ServerResponse> agencyRoutes(AgencyController agen
我在我的项目配置bean中使用缓存驱逐,而且它没有运行。我在另一个项目中使用了这个类,并且工作得很好,但我现在不知道问题在哪里。
@Configuration
@Slf4j
public class CacheConfig {
public static final String BANKCODE_CACHE_NAME = "cacheName";
@CacheEvict(allEntries = true, cacheNames = { CACHE_NAME })
@Scheduled(fixedRate = 5000)
public vo