So my company would like to upgrade their API. Currently they are using:
Swagger: 1.3.8
Swagger Maven Plugin: 2.3
I am trying to upgrade to:
Swagger: 1.5.10
Swagger Maven Plugin: 3.1.3
I have a VERY, but very simple configuration at the POM, because I have been getting errors, and honestly the error message in the console is not very helpful. I am sure you guys will be able to help me.
ERROR:
Failed to execute goal com.github.kongchen:swagger-maven-plugin:3.1.3:generate (default) on project AMRestServices: Unrecognized Type: [null] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.kongchen:swagger-maven-plugin:3.1.3:generate (default) on project AMRestServices: Unrecognized Type: [null]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unrecognized Type: [null]
at com.github.kongchen.swagger.docgen.mavenplugin.ApiDocumentMojo.execute(ApiDocumentMojo.java:125)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.IllegalArgumentException: Unrecognized Type: [null]
at com.fasterxml.jackson.databind.type.TypeFactory._constructType(TypeFactory.java:406)
at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:354)
at com.fasterxml.jackson.databind.ObjectMapper.constructType(ObjectMapper.java:1202)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:103)
at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolveProperty(ModelModifier.java:60)
at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:355)
at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolve(ModelModifier.java:78)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:159)
at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolve(ModelModifier.java:72)
at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:99)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:138)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:103)
at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolveProperty(ModelModifier.java:60)
at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79)
at io.swagger.converter.ModelConverters.readAsProperty(ModelConverters.java:58)
at com.github.kongchen.swagger.docgen.reader.AbstractReader.isPrimitive(AbstractReader.java:288)
at com.github.kongchen.swagger.docgen.reader.JaxrsReader.parseMethod(JaxrsReader.java:255)
at com.github.kongchen.swagger.docgen.reader.JaxrsReader.read(JaxrsReader.java:94)
at com.github.kongchen.swagger.docgen.reader.JaxrsReader.read(JaxrsReader.java:51)
at com.github.kongchen.swagger.docgen.reader.JaxrsReader.read(JaxrsReader.java:42)
at com.github.kongchen.swagger.docgen.mavenplugin.MavenDocumentSource.loadDocuments(MavenDocumentSource.java:46)
at com.github.kongchen.swagger.docgen.mavenplugin.ApiDocumentMojo.execute(ApiDocumentMojo.java:95)
... 21 more
If I try:
Swagger: 1.5.10
Swagger Maven Plugin: 3.0.0
I get no error but swagger.json just has:
{
"swagger" : "2.0",
"info" : {
"version" : "v1",
"title" : "Test"
}
}
So my company would like to upgrade their API. Currently they are using: Swagger: 1.3.8 Swagger Maven Plugin: 2.3
I am trying to upgrade to: Swagger: 1.5.10 Swagger Maven Plugin: 3.1.3
I have a VERY, but very simple configuration at the POM, because I have been getting errors, and honestly the error message in the console is not very helpful. I am sure you guys will be able to help me.
ERROR: Failed to execute goal com.github.kongchen:swagger-maven-plugin:3.1.3:generate (default) on project AMRestServices: Unrecognized Type: [null] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.kongchen:swagger-maven-plugin:3.1.3:generate (default) on project AMRestServices: Unrecognized Type: [null] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 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:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.MojoExecutionException: Unrecognized Type: [null] at com.github.kongchen.swagger.docgen.mavenplugin.ApiDocumentMojo.execute(ApiDocumentMojo.java:125) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more Caused by: java.lang.IllegalArgumentException: Unrecognized Type: [null] at com.fasterxml.jackson.databind.type.TypeFactory._constructType(TypeFactory.java:406) at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:354) at com.fasterxml.jackson.databind.ObjectMapper.constructType(ObjectMapper.java:1202) at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:103) at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolveProperty(ModelModifier.java:60) at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79) at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:355) at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolve(ModelModifier.java:78) at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:159) at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolve(ModelModifier.java:72) at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:99) at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:138) at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:103) at com.github.kongchen.swagger.docgen.reader.ModelModifier.resolveProperty(ModelModifier.java:60) at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:79) at io.swagger.converter.ModelConverters.readAsProperty(ModelConverters.java:58) at com.github.kongchen.swagger.docgen.reader.AbstractReader.isPrimitive(AbstractReader.java:288) at com.github.kongchen.swagger.docgen.reader.JaxrsReader.parseMethod(JaxrsReader.java:255) at com.github.kongchen.swagger.docgen.reader.JaxrsReader.read(JaxrsReader.java:94) at com.github.kongchen.swagger.docgen.reader.JaxrsReader.read(JaxrsReader.java:51) at com.github.kongchen.swagger.docgen.reader.JaxrsReader.read(JaxrsReader.java:42) at com.github.kongchen.swagger.docgen.mavenplugin.MavenDocumentSource.loadDocuments(MavenDocumentSource.java:46) at com.github.kongchen.swagger.docgen.mavenplugin.ApiDocumentMojo.execute(ApiDocumentMojo.java:95) ... 21 more
If I try: Swagger: 1.5.10 Swagger Maven Plugin: 3.0.0
I get no error but swagger.json just has: { "swagger" : "2.0", "info" : { "version" : "v1", "title" : "Test" } }