Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type of parameter 'model' must not be blank #10

Closed
tclegg1974 opened this issue May 22, 2018 · 7 comments
Closed

Type of parameter 'model' must not be blank #10

tclegg1974 opened this issue May 22, 2018 · 7 comments

Comments

@tclegg1974
Copy link

I get a swagger URL fine just can't generate a pdf file.

Spring Boot 1.5.11
<swagger.version>2.8.0</swagger.version>
<swagger.staticdocs>2.6.1</swagger.staticdocs>

I also see null, null and don't know why as the demo does not have this??

INFO] reading from /Users/clegga/partner-rewards-api/partner-rewards-rest/target/swagger/swagger.json
[DEBUG] no property for null, null
[DEBUG] no property for null, null
[DEBUG] no property for null, null
[DEBUG] Generate examples is disabled.

[ERROR] Failed to execute goal io.github.swagger2markup:swagger2markup-maven-plugin:1.2.0:convertSwagger2markup (default) on project partner-rewards-rest: Failed to execute goal 'convertSwagger2markup': Type of parameter 'model' must not be blank -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.github.swagger2markup:swagger2markup-maven-plugin:1.2.0:convertSwagger2markup (default) on project partner-rewards-rest: Failed to execute goal 'convertSwagger2markup'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
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:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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.apache.maven.plugin.MojoFailureException: Failed to execute goal 'convertSwagger2markup'
at io.github.swagger2markup.Swagger2MarkupMojo.execute(Swagger2MarkupMojo.java:74)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.NullPointerException: Type of parameter 'model' must not be blank
at org.apache.commons.lang3.Validate.notBlank(Validate.java:448)
at io.github.swagger2markup.internal.type.BasicType.(BasicType.java:41)
at io.github.swagger2markup.internal.adapter.ParameterAdapter.getType(ParameterAdapter.java:176)
at io.github.swagger2markup.internal.adapter.ParameterAdapter.(ParameterAdapter.java:57)
at io.github.swagger2markup.internal.component.ParameterTableComponent.apply(ParameterTableComponent.java:91)
at io.github.swagger2markup.internal.component.PathOperationComponent.buildParametersSection(PathOperationComponent.java:198)
at io.github.swagger2markup.internal.component.PathOperationComponent.apply(PathOperationComponent.java:100)
at io.github.swagger2markup.internal.document.PathsDocument.applyPathOperationComponent(PathsDocument.java:223)
at io.github.swagger2markup.internal.document.PathsDocument.buildOperation(PathsDocument.java:207)
at io.github.swagger2markup.internal.document.PathsDocument.lambda$null$1(PathsDocument.java:133)
at java.lang.Iterable.forEach(Iterable.java:75)
at io.github.swagger2markup.internal.document.PathsDocument.lambda$buildsPathsSection$2(PathsDocument.java:133)
at java.util.TreeMap.forEach(TreeMap.java:1005)
at io.github.swagger2markup.internal.document.PathsDocument.buildsPathsSection(PathsDocument.java:127)
at io.github.swagger2markup.internal.document.PathsDocument.apply(PathsDocument.java:103)
at io.github.swagger2markup.Swagger2MarkupConverter.applyPathsDocument(Swagger2MarkupConverter.java:197)
at io.github.swagger2markup.Swagger2MarkupConverter.toFolder(Swagger2MarkupConverter.java:182)
at io.github.swagger2markup.Swagger2MarkupMojo.execute(Swagger2MarkupMojo.java:69)
... 22 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@RobWin
Copy link
Member

RobWin commented May 22, 2018

Did you try to fix the issue -> Type of parameter 'model' must not be blank ?

@tclegg1974
Copy link
Author

I have resolved the issue. It turns out that I had several controllers which come out fine in swagger UI but don't have a model defined. /error being one. In order to resolve this I had to update the Docket definition to exclude these end points. Once excluded the PDF was generated as expected! Thanks for a great plugin.

return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.paths(Predicates.and(ant("/"), Predicates.not(ant("/error")), Predicates.not(ant("/api/promotions*")), Predicates.not(ant("/api/promotions/")), Predicates.not(ant("/management/**")), Predicates.not(ant("/management*"))))
.build();

@ghost
Copy link

ghost commented Nov 7, 2018

This is still an issue. Swagger-UI Renders those fine, but Swagger2MarkupMojo does fail.
The error message doesn't tell me which definition cuases the problem. Cannot find out which definition is causing the problem. Please include the problemativ definition in the error message an continue rendering as there might be many of those. Message should be "warning", not "error".

@nagendradarla
Copy link

This is still a issue.
I raised below bug:

#16

@nagendradarla
Copy link

[ERROR] Failed to execute goal io.github.swagger2markup:swagger2markup-maven-plugin:1.3.1:convertSwagger2markup (default) on project uam-service: Failed to execute goal 'convertSwagger2markup': Type of parameter 'revokeApplications' must not be blank -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.github.swagger2markup:swagger2markup-maven-plugin:1.3.1:convertSwagger2markup (default) on project uam-service: Failed to execute goal 'convertSwagger2markup'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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: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)
Caused by: org.apache.maven.plugin.MojoFailureException: Failed to execute goal 'convertSwagger2markup'
at io.github.swagger2markup.Swagger2MarkupMojo.execute (Swagger2MarkupMojo.java:74)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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: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)
Caused by: java.lang.NullPointerException: Type of parameter 'revokeApplications' must not be blank
at org.apache.commons.lang3.Validate.notBlank (Validate.java:448)
at io.github.swagger2markup.internal.type.BasicType. (BasicType.java:41)
at io.github.swagger2markup.internal.adapter.ParameterAdapter.getType (ParameterAdapter.java:176)
at io.github.swagger2markup.internal.adapter.ParameterAdapter. (ParameterAdapter.java:57)
at io.github.swagger2markup.internal.component.ParameterTableComponent.apply (ParameterTableComponent.java:91)
at io.github.swagger2markup.internal.component.PathOperationComponent.buildParametersSection (PathOperationComponent.java:198)
at io.github.swagger2markup.internal.component.PathOperationComponent.apply (PathOperationComponent.java:100)
at io.github.swagger2markup.internal.document.PathsDocument.applyPathOperationComponent (PathsDocument.java:223)
at io.github.swagger2markup.internal.document.PathsDocument.buildOperation (PathsDocument.java:207)
at io.github.swagger2markup.internal.document.PathsDocument.lambda$null$1 (PathsDocument.java:133)
at java.lang.Iterable.forEach (Iterable.java:75)
at io.github.swagger2markup.internal.document.PathsDocument.lambda$buildsPathsSection$2 (PathsDocument.java:133)
at java.util.TreeMap.forEach (TreeMap.java:1005)
at io.github.swagger2markup.internal.document.PathsDocument.buildsPathsSection (PathsDocument.java:127)
at io.github.swagger2markup.internal.document.PathsDocument.apply (PathsDocument.java:103)
at io.github.swagger2markup.Swagger2MarkupConverter.applyPathsDocument (Swagger2MarkupConverter.java:197)
at io.github.swagger2markup.Swagger2MarkupConverter.toFolder (Swagger2MarkupConverter.java:182)
at io.github.swagger2markup.Swagger2MarkupMojo.execute (Swagger2MarkupMojo.java:69)
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:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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: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]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@Ascalonian
Copy link

I am still receiving this in 1.3.3 - is there a solution to this?
@nagendradarla

@gm100861
Copy link

This is still a issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants