java.lang.IllegalArgumentException: No enum constant springfox.documentation.service.ParameterType.Q

java.lang.IllegalArgumentException: No enum constant springfox.documentation.service.ParameterType.QUERY

项目使用springBoot整合swagger时启动报错:

java.lang.IllegalArgumentException: No enum constant springfox.documentation.service.ParameterType.REQUEST
	at java.lang.Enum.valueOf(Enum.java:238)
	at springfox.documentation.service.ParameterType.valueOf(ParameterType.java:6)
	at springfox.documentation.builders.ParameterBuilder.parameterType(ParameterBuilder.java:170)
	at springfox.documentation.swagger.readers.operation.OperationImplicitParameterReader.implicitParameter(OperationImplicitParameterReader.java:108)
	at springfox.documentation.swagger.readers.operation.OperationImplicitParametersReader.readParameters(OperationImplicitParametersReader.java:83)
	at springfox.documentation.swagger.readers.operation.OperationImplicitParametersReader.apply(OperationImplicitParametersReader.java:57)
	at springfox.documentation.spring.web.plugins.DocumentationPluginsManager.operation(DocumentationPluginsManager.java:144)
	at springfox.documentation.spring.web.readers.operation.ApiOperationReader.read(ApiOperationReader.java:72)
	at springfox.documentation.spring.web.scanners.CachingOperationReader.lambda$new$0(CachingOperationReader.java:43)
	at java.util.HashMap.computeIfAbsent(HashMap.java:1127)
	at springfox.documentation.spring.web.scanners.CachingOperationReader.read(CachingOperationReader.java:48)
	at springfox.documentation.spring.web.scanners.ApiDescriptionReader.read(ApiDescriptionReader.java:72)
	at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:169)
	at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:67)
	at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.scanDocumentation(AbstractDocumentationPluginsBootstrapper.java:96)
	at springfox.documentation.spring.web.plugins.AbstractDocumentationPluginsBootstrapper.bootstrapDocumentationPlugins(AbstractDocumentationPluginsBootstrapper.java:82)
	at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:100)
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)

我们可以看到错误信息中提示没有枚举类型REQUEST;
我们可以可以下swagger支持的枚举类型包括:

public enum ParameterType {
  QUERY("query"),
  HEADER("header"),
  PATH("path"),
  COOKIE("cookie"),
  FORM("form"),
  FORMDATA("formData"),
  BODY("body");

所以得找到系统中将paramType="request"的地方
java.lang.IllegalArgumentException: No enum constant springfox.documentation.service.ParameterType.Q_第1张图片
将paramType改成query,重新启动系统就好了

你可能感兴趣的:(问题解决,JAVA,java)