Comments (5)
Hi @knuthaug , I guess one of the value of allowableValues
in your document is invalid. Swagger only recognize the values such as range[a,b]
, rangeexclusive[x,y]
and a,b,c,d
(See com.wordnik.swagger.model.AnyAllowableValues$toAllowableValues
for more details)
However, thanks for report it, I've added some trace in the log which can help find out where the error comes. Have a try!
from swagger-maven-plugin.
Actually, I have no allowableValues configured at the moment (I just migrated the project to swagger 1.3.x.) As far as I can see, the AllowableValues annotation is optional? I fixed the issue with a small test in MustacheParameter.java to get rid of the error and built the docs. I am unsure if this is the right approach. I also fixed a null-pointer in TypeUtils.java. Both these might be due to incomplete annotations in my services. You want to take look at the code in a pull request?
from swagger-maven-plugin.
Yes, It's optional.
I'm so curious that you got error even you have no allowableValues
configured. I tired and it's OK. Could you please send out the trace about
the GenerateException: Parse failed in Operation....
Besides, I'd like to see your patch, thanks!
2014-02-05 Knut Haugen [email protected]:
Actually, I have no allowableValues configured at the moment (I just
migrated the project to swagger 1.3.x.) As far as I can see, the
AllowableValues annotation is optional? I fixed the issue with a small test
in MustacheParameter.java to get rid of the error and built the docs. I am
unsure if this is the right approach. I also fixed a null-pointer in
TypeUtils.java. Both these might be due to incomplete annotations in my
services. You want to take look at the code in a pull request?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/36#issuecomment-34142290
.
Regards,
Kong
from swagger-maven-plugin.
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.kongchen:swagger-maven-plugin:2.0-SNAPSHOT:generate (default) on project gaia-webapp: Parse failed in Operation(GET,Get one property by key,Fetches infrastructure configuration elements,ApiProperty,getPropertyById,0,List(application/json, application/xml),List(),List(),List(Authorization(,[Lcom.wordnik.swagger.model.AuthorizationScope;@543d8398)),List(Parameter(property,None,None,true,false,string,AnyAllowableValues,path,None)),List(ResponseMessage(500,Errors reading properties,None), ResponseMessage(404,Property by that key was not found,None)),None) Error:Parse failed in Parameter(property,None,None,true,false,string,AnyAllowableValues,path,None)Error:Invalid allowableValues
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.MojoFailureException: Parse failed in Operation(GET,Get one property by key,Fetches infrastructure configuration elements,ApiProperty,getPropertyById,0,List(application/json, application/xml),List(),List(),List(Authorization(,[Lcom.wordnik.swagger.model.AuthorizationScope;@543d8398)),List(Parameter(property,None,None,true,false,string,AnyAllowableValues,path,None)),List(ResponseMessage(500,Errors reading properties,None), ResponseMessage(404,Property by that key was not found,None)),None) Error:Parse failed in Parameter(property,None,None,true,false,string,AnyAllowableValues,path,None)Error:Invalid allowableValues
at com.github.kongchen.swagger.docgen.mavenplugin.ApiDocumentMojo.execute(ApiDocumentMojo.java:69)
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: com.github.kongchen.swagger.docgen.GenerateException: Parse failed in Operation(GET,Get one property by key,Fetches infrastructure configuration elements,ApiProperty,getPropertyById,0,List(application/json, application/xml),List(),List(),List(Authorization(,[Lcom.wordnik.swagger.model.AuthorizationScope;@543d8398)),List(Parameter(property,None,None,true,false,string,AnyAllowableValues,path,None)),List(ResponseMessage(500,Errors reading properties,None), ResponseMessage(404,Property by that key was not found,None)),None) Error:Parse failed in Parameter(property,None,None,true,false,string,AnyAllowableValues,path,None)Error:Invalid allowableValues
at com.github.kongchen.swagger.docgen.mustache.OutputTemplate.createMustacheDocument(OutputTemplate.java:104)
at com.github.kongchen.swagger.docgen.mustache.OutputTemplate.feedSource(OutputTemplate.java:164)
at com.github.kongchen.swagger.docgen.mustache.OutputTemplate.(OutputTemplate.java:30)
at com.github.kongchen.swagger.docgen.AbstractDocumentSource.prepareMustacheTemplate(AbstractDocumentSource.java:218)
at com.github.kongchen.swagger.docgen.AbstractDocumentSource.toDocuments(AbstractDocumentSource.java:224)
at com.github.kongchen.swagger.docgen.mavenplugin.ApiDocumentMojo.execute(ApiDocumentMojo.java:64)
... 21 more
from swagger-maven-plugin.
resolved
from swagger-maven-plugin.
Related Issues (20)
- NullPointerException if apiSource/outputFormats is not present HOT 3
- enabledObjectMapperFeatures and disabledObjectMapperFeatures are documented at the wrong configuration level
- log4j Vulnerability in Dependencies HOT 1
- Error with newer Java Version: could not get type for name
- how generate openapi 3.0 file HOT 3
- when support swagger3.0? HOT 2
- Generate Tags for Spring Controllers HOT 2
- Sort paths by summary
- Two Class have same @ApiModel, result in One class modified and swagger.json do not change
- enabledObjectMapperFeatures not found
- -Dswagger.skip=false doesn't trigger plugin HOT 1
- Updating to jakarta.xml.bind >4 doesn't generate anymore the swaggers HOT 9
- When using both ‘@RequestParam’ and ‘@ApiImplicitParam’ at the same time, it will generate duplicate parameters in swagger.json HOT 1
- how to add all api common header,like Authorization, donot add in each api for @headerparams
- Different line endings for generated swagger.json (CRLF) and swagger.yaml (LF) on Windows Git bash
- toggle an option to automatically generate swagger annotations on jax-rs annotated classes
- If ResponseStatus is specified for operation that should be used as default response not 200
- Error on JDK21 HOT 1
- How to exclude classes from becoming schemas? HOT 3
- is this plugin callable form command line?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-maven-plugin.