其他分享
首页 > 其他分享> > springboot swagger文件批量上传问题

springboot swagger文件批量上传问题

作者:互联网

问题1:

springboot swagger不支持批量上传文件,批量上传接收的数据是空

问题2:

The valid characters are defined in RFC 7230 and RFC 3986  

根因是tomcat7之后,严格限制了url。

@Component
public class PortalTomcatWebServerCustomizer implements WebServerFactoryCustomizer {


@Override
public void customize(WebServerFactory container) {
TomcatServletWebServerFactory containerFactory = (TomcatServletWebServerFactory) container;
containerFactory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
@Override
public void customize(Connector connector) {
connector.setProperty("relaxedQueryChars", "[]|-\\:{}^.<>");
connector.setProperty("relaxedPathChars", "[]|-\\:");
}
});
}
}

标签:文件批量,container,springboot,connector,Override,swagger,上传
来源: https://www.cnblogs.com/ranger-man/p/14819000.html