Giter Club home page Giter Club logo

Comments (5)

kongchen avatar kongchen commented on May 18, 2024

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.

knuthaug avatar knuthaug commented on May 18, 2024

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.

kongchen avatar kongchen commented on May 18, 2024

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.

knuthaug avatar knuthaug commented on May 18, 2024

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.

kongchen avatar kongchen commented on May 18, 2024

resolved

from swagger-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.