如何从springboot中的src文件夹外部访问yaml @Configuration 公共类swaggerspecconfig{
@Value("${spring.resource:val}")
private String path;
@Primary
@Bean
public SwaggerResourcesProvider swaggerResourcesProvider(InMemorySwaggerResourcesProvider defaultResourcesProvider) {
return () -> {
SwaggerResource wsResource = new SwaggerResource();
wsResource.setName("new spec");
wsResource.setSwaggerVersion("2.0");
//wsResource.setLocation("/config/microcks-openapi-v1.2.yaml");
wsResource.setLocation(path);
List<SwaggerResource> resources = new ArrayList<>(defaultResourcesProvider.get());
resources.add(wsResource);
return resources;
};
}
}
暂无答案!
目前还没有任何答案,快来回答吧!