kpramesh2212 / openapi-merger-plugin

A plugin to merge openapi v3 files
Apache License 2.0
20 stars 8 forks source link

The plugin does not like `openapi: 3.1.0` #12

Open wilx opened 2 years ago

wilx commented 2 years ago

I get the following error when I try to use the plugin with OpenAPI 3.1.0:

kv? 30, 2022 10:51:09 DOP. org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 6.0.2.Final
[ERROR] failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"openapi: 3.1.0
[...redacted...]
    at com.fasterxml.jackson.core.JsonParser._constructError (JsonParser.java:1851)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError (ParserMinimalBase.java:717)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken (ReaderBasedJsonParser.java:2898)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue (ReaderBasedJsonParser.java:1944)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken (ReaderBasedJsonParser.java:776)
    at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose (ObjectMapper.java:4511)
    at com.fasterxml.jackson.databind.ObjectMapper.readTree (ObjectMapper.java:2940)
    at io.swagger.parser.SwaggerCompatConverter.readResourceListing (SwaggerCompatConverter.java:210)
    at io.swagger.parser.SwaggerCompatConverter.read (SwaggerCompatConverter.java:123)
    at io.swagger.parser.SwaggerCompatConverter.readWithInfo (SwaggerCompatConverter.java:94)
    at io.swagger.parser.SwaggerParser.readWithInfo (SwaggerParser.java:42)
    at io.swagger.v3.parser.converter.SwaggerConverter.readLocation (SwaggerConverter.java:89)
    at io.swagger.v3.parser.OpenAPIV3Parser.read (OpenAPIV3Parser.java:116)
    at com.rameshkp.openapi.merger.app.OpenApiMergerApp.merge (OpenApiMergerApp.kt:37)
    at com.rameshkp.openapi.merger.maven.plugin.OpenApiMergerMojo.execute (OpenApiMergerMojo.java:62)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
java.lang.NullPointerException
    at io.swagger.v3.parser.OpenAPIV3Parser.read (OpenAPIV3Parser.java:117)
    at com.rameshkp.openapi.merger.app.OpenApiMergerApp.merge (OpenApiMergerApp.kt:37)
    at com.rameshkp.openapi.merger.maven.plugin.OpenApiMergerMojo.execute (OpenApiMergerMojo.java:62)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
wilx commented 2 years ago

I guess this is related: https://github.com/swagger-api/swagger-parser/issues/1535