[BUG][jaxrs-jersey] Generating @DefaultValue("null") for query parameter with referenced enum is wrong
Created by: jmini
Description
Generatated @DefaultValue("null")
in the Api
file is wrong.
With the provided example, in SomeApi
:
@GET
@Path("/change")
@Produces({ "application/json" })
@io.swagger.annotations.ApiOperation(value = "", notes = "", response = String.class, tags={ "Some", })
@io.swagger.annotations.ApiResponses(value = {
@io.swagger.annotations.ApiResponse(code = 200, message = "Ok", response = String.class) })
public Response changeGet(@ApiParam(value = "", defaultValue="null") @DefaultValue("null") @QueryParam("color") BasicColor color
,@Context SecurityContext securityContext)
throws NotFoundException {
return delegate.changeGet(color,securityContext);
}
Should be @DefaultValue("RED")
in order for the server to start.
openapi-generator version
There was no issue with 3.2.0
. Reproducible with 3.3.4
and 4.0.0-SNAPSHOT
OpenAPI declaration file content or url
openapi: 3.0.1
info:
title: Default value test
version: '1.0'
servers:
- url: 'http://localhost:8088/'
paths:
/ping:
get:
tags:
- Some
operationId: pingGet
responses:
'200':
description: Ok
content:
application/json:
schema:
type: string
/say:
get:
tags:
- Some
operationId: sayGet
parameters:
- name: message
in: query
required: false
schema:
type: string
default: hello
responses:
'200':
description: Ok
content:
application/json:
schema:
type: string
/reply:
get:
tags:
- Some
operationId: replyGet
parameters:
- name: something
in: query
required: false
schema:
type: string
responses:
'200':
description: Ok
content:
application/json:
schema:
type: string
/select:
get:
tags:
- Some
operationId: selectGet
parameters:
- name: dayOfTheWeek
in: query
required: false
schema:
$ref: "#/components/schemas/Day"
responses:
'200':
description: Ok
content:
application/json:
schema:
type: string
/change:
get:
tags:
- Some
operationId: changeGet
parameters:
- name: color
in: query
required: false
schema:
$ref: "#/components/schemas/BasicColor"
responses:
'200':
description: Ok
content:
application/json:
schema:
type: string
/modify:
get:
tags:
- Some
operationId: modifyGet
parameters:
- name: priority
in: query
required: false
schema:
type: string
default: low
enum:
- "high"
- "medium"
- "low"
responses:
'200':
description: Ok
content:
application/json:
schema:
type: string
/check:
get:
tags:
- Some
operationId: checkGet
parameters:
- name: status
in: query
required: false
schema:
type: string
enum:
- "Ok"
- "Error"
responses:
'200':
description: Ok
content:
application/json:
schema:
type: string
components:
schemas:
Day:
type: string
enum:
- "Monday"
- "Tuesday"
- "Wednesday"
- "Thursday"
- "Friday"
- "Saturday"
- "Sunday"
BasicColor:
type: string
default: Red
enum:
- "Red"
- "Blue"
- "Green"
Command line used for generation
Jersey generator
Steps to reproduce
Start the server, you will see stacktrace like:
org.glassfish.jersey.internal.inject.ExtractorException: org.glassfish.jersey.internal.inject.ExtractorException: java.lang.IllegalArgumentException: No enum constant org.openapitools.model.BasicColor.null
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.convert (AbstractParamValueExtractor.java:145)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.access$000 (AbstractParamValueExtractor.java:56)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor$1.get (AbstractParamValueExtractor.java:85)
at org.glassfish.jersey.internal.util.collection.Values$LazyUnsafeValueImpl.get (Values.java:425)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.<init> (AbstractParamValueExtractor.java:91)
at org.glassfish.jersey.server.internal.inject.SingleValueExtractor.<init> (SingleValueExtractor.java:67)
at org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory.process (MultivaluedParameterExtractorFactory.java:123)
at org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory.get (MultivaluedParameterExtractorFactory.java:100)
at org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider.get (AbstractValueFactoryProvider.java:106)
at org.glassfish.jersey.server.internal.inject.QueryParamValueFactoryProvider.createValueFactory (QueryParamValueFactoryProvider.java:116)
at org.glassfish.jersey.server.internal.inject.QueryParamValueFactoryProvider.createValueFactory (QueryParamValueFactoryProvider.java:59)
at org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider.getValueFactory (AbstractValueFactoryProvider.java:134)
at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getValueFactory (ParameterValueHelper.java:183)
at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.createValueProviders (ParameterValueHelper.java:147)
at org.glassfish.jersey.server.model.Invocable.getValueProviders (Invocable.java:320)
at org.glassfish.jersey.server.model.ResourceMethodValidator.checkValueProviders (ResourceMethodValidator.java:165)
at org.glassfish.jersey.server.model.ResourceMethodValidator.checkMethod (ResourceMethodValidator.java:106)
at org.glassfish.jersey.server.model.ResourceMethodValidator.visitJaxrsResourceMethod (ResourceMethodValidator.java:102)
at org.glassfish.jersey.server.model.ResourceMethodValidator.visitResourceMethod (ResourceMethodValidator.java:92)
at org.glassfish.jersey.server.model.ResourceMethod.accept (ResourceMethod.java:873)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:161)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.access$000 (ComponentModelValidator.java:90)
at org.glassfish.jersey.server.model.ComponentModelValidator$1.run (ComponentModelValidator.java:151)
at org.glassfish.jersey.internal.Errors$1.call (Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call (Errors.java:267)
at org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at org.glassfish.jersey.internal.Errors.process (Errors.java:267)
at org.glassfish.jersey.server.model.ComponentModelValidator.validate (ComponentModelValidator.java:146)
at org.glassfish.jersey.server.ApplicationHandler.initialize (ApplicationHandler.java:550)
at org.glassfish.jersey.server.ApplicationHandler.access$500 (ApplicationHandler.java:184)
at org.glassfish.jersey.server.ApplicationHandler$3.call (ApplicationHandler.java:350)
at org.glassfish.jersey.server.ApplicationHandler$3.call (ApplicationHandler.java:347)
at org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException (Errors.java:255)
at org.glassfish.jersey.server.ApplicationHandler.<init> (ApplicationHandler.java:347)
at org.glassfish.jersey.servlet.WebComponent.<init> (WebComponent.java:392)
at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:177)
at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:369)
at javax.servlet.GenericServlet.init (GenericServlet.java:244)
at org.eclipse.jetty.servlet.ServletHolder.initServlet (ServletHolder.java:612)
at org.eclipse.jetty.servlet.ServletHolder.initialize (ServletHolder.java:395)
at org.eclipse.jetty.servlet.ServletHandler.initialize (ServletHandler.java:871)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:298)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1349)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:296)
at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:505)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:365)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start (Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart (Server.java:354)
at org.eclipse.jetty.maven.plugin.JettyServer.doStart (JettyServer.java:73)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:534)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:357)
at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:167)
at org.eclipse.jetty.maven.plugin.JettyStartMojo.execute (JettyStartMojo.java:48)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.glassfish.jersey.internal.inject.ExtractorException: java.lang.IllegalArgumentException: No enum constant org.openapitools.model.BasicColor.null
at org.glassfish.jersey.server.internal.inject.ParamConverters$AbstractStringReader.fromString (ParamConverters.java:95)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.convert (AbstractParamValueExtractor.java:139)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.access$000 (AbstractParamValueExtractor.java:56)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor$1.get (AbstractParamValueExtractor.java:85)
at org.glassfish.jersey.internal.util.collection.Values$LazyUnsafeValueImpl.get (Values.java:425)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.<init> (AbstractParamValueExtractor.java:91)
at org.glassfish.jersey.server.internal.inject.SingleValueExtractor.<init> (SingleValueExtractor.java:67)
at org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory.process (MultivaluedParameterExtractorFactory.java:123)
at org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory.get (MultivaluedParameterExtractorFactory.java:100)
at org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider.get (AbstractValueFactoryProvider.java:106)
at org.glassfish.jersey.server.internal.inject.QueryParamValueFactoryProvider.createValueFactory (QueryParamValueFactoryProvider.java:116)
at org.glassfish.jersey.server.internal.inject.QueryParamValueFactoryProvider.createValueFactory (QueryParamValueFactoryProvider.java:59)
at org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider.getValueFactory (AbstractValueFactoryProvider.java:134)
at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getValueFactory (ParameterValueHelper.java:183)
at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.createValueProviders (ParameterValueHelper.java:147)
at org.glassfish.jersey.server.model.Invocable.getValueProviders (Invocable.java:320)
at org.glassfish.jersey.server.model.ResourceMethodValidator.checkValueProviders (ResourceMethodValidator.java:165)
at org.glassfish.jersey.server.model.ResourceMethodValidator.checkMethod (ResourceMethodValidator.java:106)
at org.glassfish.jersey.server.model.ResourceMethodValidator.visitJaxrsResourceMethod (ResourceMethodValidator.java:102)
at org.glassfish.jersey.server.model.ResourceMethodValidator.visitResourceMethod (ResourceMethodValidator.java:92)
at org.glassfish.jersey.server.model.ResourceMethod.accept (ResourceMethod.java:873)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:161)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.access$000 (ComponentModelValidator.java:90)
at org.glassfish.jersey.server.model.ComponentModelValidator$1.run (ComponentModelValidator.java:151)
at org.glassfish.jersey.internal.Errors$1.call (Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call (Errors.java:267)
at org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at org.glassfish.jersey.internal.Errors.process (Errors.java:267)
at org.glassfish.jersey.server.model.ComponentModelValidator.validate (ComponentModelValidator.java:146)
at org.glassfish.jersey.server.ApplicationHandler.initialize (ApplicationHandler.java:550)
at org.glassfish.jersey.server.ApplicationHandler.access$500 (ApplicationHandler.java:184)
at org.glassfish.jersey.server.ApplicationHandler$3.call (ApplicationHandler.java:350)
at org.glassfish.jersey.server.ApplicationHandler$3.call (ApplicationHandler.java:347)
at org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException (Errors.java:255)
at org.glassfish.jersey.server.ApplicationHandler.<init> (ApplicationHandler.java:347)
at org.glassfish.jersey.servlet.WebComponent.<init> (WebComponent.java:392)
at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:177)
at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:369)
at javax.servlet.GenericServlet.init (GenericServlet.java:244)
at org.eclipse.jetty.servlet.ServletHolder.initServlet (ServletHolder.java:612)
at org.eclipse.jetty.servlet.ServletHolder.initialize (ServletHolder.java:395)
at org.eclipse.jetty.servlet.ServletHandler.initialize (ServletHandler.java:871)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:298)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1349)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:296)
at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:505)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:365)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start (Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart (Server.java:354)
at org.eclipse.jetty.maven.plugin.JettyServer.doStart (JettyServer.java:73)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:534)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:357)
at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:167)
at org.eclipse.jetty.maven.plugin.JettyStartMojo.execute (JettyStartMojo.java:48)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.IllegalArgumentException: No enum constant org.openapitools.model.BasicColor.null
at java.lang.Enum.valueOf (Enum.java:238)
at org.openapitools.model.BasicColor.valueOf (BasicColor.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.glassfish.jersey.server.internal.inject.ParamConverters$TypeValueOf$1._fromString (ParamConverters.java:157)
at org.glassfish.jersey.server.internal.inject.ParamConverters$AbstractStringReader.fromString (ParamConverters.java:85)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.convert (AbstractParamValueExtractor.java:139)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.access$000 (AbstractParamValueExtractor.java:56)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor$1.get (AbstractParamValueExtractor.java:85)
at org.glassfish.jersey.internal.util.collection.Values$LazyUnsafeValueImpl.get (Values.java:425)
at org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor.<init> (AbstractParamValueExtractor.java:91)
at org.glassfish.jersey.server.internal.inject.SingleValueExtractor.<init> (SingleValueExtractor.java:67)
at org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory.process (MultivaluedParameterExtractorFactory.java:123)
at org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorFactory.get (MultivaluedParameterExtractorFactory.java:100)
at org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider.get (AbstractValueFactoryProvider.java:106)
at org.glassfish.jersey.server.internal.inject.QueryParamValueFactoryProvider.createValueFactory (QueryParamValueFactoryProvider.java:116)
at org.glassfish.jersey.server.internal.inject.QueryParamValueFactoryProvider.createValueFactory (QueryParamValueFactoryProvider.java:59)
at org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider.getValueFactory (AbstractValueFactoryProvider.java:134)
at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getValueFactory (ParameterValueHelper.java:183)
at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.createValueProviders (ParameterValueHelper.java:147)
at org.glassfish.jersey.server.model.Invocable.getValueProviders (Invocable.java:320)
at org.glassfish.jersey.server.model.ResourceMethodValidator.checkValueProviders (ResourceMethodValidator.java:165)
at org.glassfish.jersey.server.model.ResourceMethodValidator.checkMethod (ResourceMethodValidator.java:106)
at org.glassfish.jersey.server.model.ResourceMethodValidator.visitJaxrsResourceMethod (ResourceMethodValidator.java:102)
at org.glassfish.jersey.server.model.ResourceMethodValidator.visitResourceMethod (ResourceMethodValidator.java:92)
at org.glassfish.jersey.server.model.ResourceMethod.accept (ResourceMethod.java:873)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:161)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.validateWithErrors (ComponentModelValidator.java:167)
at org.glassfish.jersey.server.model.ComponentModelValidator.access$000 (ComponentModelValidator.java:90)
at org.glassfish.jersey.server.model.ComponentModelValidator$1.run (ComponentModelValidator.java:151)
at org.glassfish.jersey.internal.Errors$1.call (Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call (Errors.java:267)
at org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at org.glassfish.jersey.internal.Errors.process (Errors.java:267)
at org.glassfish.jersey.server.model.ComponentModelValidator.validate (ComponentModelValidator.java:146)
at org.glassfish.jersey.server.ApplicationHandler.initialize (ApplicationHandler.java:550)
at org.glassfish.jersey.server.ApplicationHandler.access$500 (ApplicationHandler.java:184)
at org.glassfish.jersey.server.ApplicationHandler$3.call (ApplicationHandler.java:350)
at org.glassfish.jersey.server.ApplicationHandler$3.call (ApplicationHandler.java:347)
at org.glassfish.jersey.internal.Errors.process (Errors.java:315)
at org.glassfish.jersey.internal.Errors.process (Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException (Errors.java:255)
at org.glassfish.jersey.server.ApplicationHandler.<init> (ApplicationHandler.java:347)
at org.glassfish.jersey.servlet.WebComponent.<init> (WebComponent.java:392)
at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:177)
at org.glassfish.jersey.servlet.ServletContainer.init (ServletContainer.java:369)
at javax.servlet.GenericServlet.init (GenericServlet.java:244)
at org.eclipse.jetty.servlet.ServletHolder.initServlet (ServletHolder.java:612)
at org.eclipse.jetty.servlet.ServletHolder.initialize (ServletHolder.java:395)
at org.eclipse.jetty.servlet.ServletHandler.initialize (ServletHandler.java:871)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext (ServletContextHandler.java:298)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp (WebAppContext.java:1349)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp (JettyWebAppContext.java:296)
at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:505)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:365)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart (ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start (Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart (Server.java:354)
at org.eclipse.jetty.maven.plugin.JettyServer.doStart (JettyServer.java:73)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:534)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:357)
at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:167)
at org.eclipse.jetty.maven.plugin.JettyStartMojo.execute (JettyStartMojo.java:48)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Related issues/PRs
There was https://github.com/OpenAPITools/openapi-generator/issues/540 to fix something with 3.2.2
Suggest a fix
There is some code that check for this: https://github.com/OpenAPITools/openapi-generator/blob/60ca0fb338c770f722dfa9e665e4b33666f4ed79/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java#L806-L816
But because of the referenced-Schema the block is skipped (at this point the Referenced-Schema is not a StringSchema)