We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swagger扫描到带有@scope('request')的RestController报错
Spring Cloud Huawei version: 1.11.7-2021.-.x
具体报错见附件 :swagger报错.txt
现本地修改源码仅供参考,解决了问题,建议是否可以参考 我修改的代码来屏蔽此类带有@Scpoe('request')的@RestController
private void runJavaChassisScanner() { Map<String, Object> controllers = new HashMap<>(); //修改原先的 Map<String, Object> controllers = applicationContext.getBeansWithAnnotation(RestController.class); //先找到beanname,然后用try catch过滤掉无法生成的bean final String[] beanNamesForAnnotation = applicationContext.getBeanNamesForAnnotation(RestController.class); for (String beanName : beanNamesForAnnotation) { try { Object beanInstance = applicationContext.getBean(beanName); controllers.put(beanName, beanInstance); } catch (ScopeNotActiveException e) { LOGGER.warn("bean [{}] is not active in current scope, ignore it.", beanName); } } controllers.forEach((k, v) -> { try { SpringmvcSwaggerGenerator generator = new SpringmvcSwaggerGenerator(v.getClass()); Swagger swagger = generator.generate(); swaggerContent.put(k, SwaggerUtils.swaggerToString(swagger)); LOGGER.info("generate servicecomb compatible swagger for bean [{}] success.", k); } catch (Exception e) { LOGGER.info("generate servicecomb compatible swagger for bean [{}] failed, message is [{}].", k, e.getMessage()); } }); swaggerSummary = calcSchemaSummary(); }
The text was updated successfully, but these errors were encountered:
另外麻烦同步看下#1288
Sorry, something went wrong.
[#1287] fixed swagger scan @scope("request") annotation controller pr…
4db9425
…oblem (#1297)
see #1297
No branches or pull requests
Swagger扫描到带有@scope('request')的RestController报错
Spring Cloud Huawei version: 1.11.7-2021.-.x
具体报错见附件 :swagger报错.txt
现本地修改源码仅供参考,解决了问题,建议是否可以参考 我修改的代码来屏蔽此类带有@Scpoe('request')的@RestController
The text was updated successfully, but these errors were encountered: