Closed palmerabollo closed 7 years ago
I've got a PR open #142 but I'm not sure there's anyone maintaining this project
It looks like that PR got merged and the only thing left is to get the artifact published (gentle ping @fehguy in case you're the one that can make the magic happen).
There's a 1.6.0-SNAPSHOT
published. A 1.6.0
release would be great.
Ah, good to know, thanks! In case someone else had trouble finding it, it is here: https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-play2_2.11/1.6.0-SNAPSHOT/
Play 2.6.1 is already out, better make it depend on that one. Also, probably better to make the dependency compile only, not really necessary to have this library pull play as transitive dependency. If users update to play 2.6.1 or later, and this library didn't update, they end up having to exclude the dependency every time to avoid problems and dual play libs on the classpath
It should be fine to leave the dependency at 2.6.0 since it's binary compatible with Play 2.6.x series. In case of conflict so you shouldn't get them both on the classpath, because SBT will pick the latest one (technically Ivy's latest-revision
conflict manager will, unless you changed it).
Please compile for Scala 2.12 as well.
Would be great to have a stable release because snapshot
scare me :)
Hi, when the 1.6.0 release?
We are also waiting for 1.6.0 release. It's the last thing that prevents us from upgrading to Play 2.6 and what is more important - Scala 2.12.
We are also waiting for 1.6.0 release. It's the last thing that prevents us from upgrading to Play 2.6 and what is more important - Scala 2.12.
I think scala 2.11.11 is enough. Also swagger can build cross scala version dist.
Sharing my experience : I finally decided to go with YAML first and I will probably use https://github.com/swagger-api/swagger-codegen. See this thread https://github.com/swagger-api/swagger-play/issues/138 to understand what @JFCote did. It may interest some of you. If you already have a project running on Swagger Play of course you will ignore this comment but for new project options are open I guess.
1.6.0 release is planned for next week, hold tight..
I'm getting
Error injecting constructor, scala.MatchError: @javax.inject.Inject() (of class com.sun.proxy.$Proxy6) at play.modules.swagger.SwaggerPluginImpl.
(SwaggerPlugin.scala:35) while locating play.modules.swagger.SwaggerPluginImpl at play.modules.swagger.SwaggerModule.bindings(SwaggerModule.scala:11)
using the snapshot and Play 2.6.
Any suggestions?
@Tvaroh is there more to that stack trace? Are you doing anything unusual, like using a different DI container, other Play plugins which might conflict, etc?
@dwickern I don't think there is anything unusual, just a bare Play app with awful Guice for DI and no other plugins from what I can see. Full stack trace is:
1) Error injecting constructor, scala.MatchError: @javax.inject.Inject() (of class com.sun.proxy.$Proxy6)
at play.modules.swagger.SwaggerPluginImpl.<init>(SwaggerPlugin.scala:35)
while locating play.modules.swagger.SwaggerPluginImpl
at play.modules.swagger.SwaggerModule.bindings(SwaggerModule.scala:11):
Binding(interface play.modules.swagger.SwaggerPlugin to ConstructionTarget(class play.modules.swagger.SwaggerPluginImpl) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
while locating play.modules.swagger.SwaggerPlugin
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:84)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:185)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:137)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$1.apply(DevServerStart.scala:174)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$1.apply(DevServerStart.scala:171)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1.reload(DevServerStart.scala:171)
... 25 common frames omitted
Caused by: scala.MatchError: @javax.inject.Inject() (of class com.sun.proxy.$Proxy6)
at com.fasterxml.jackson.module.scala.introspect.ScalaAnnotationIntrospector$$anonfun$1.apply(ScalaAnnotationIntrospectorModule.scala:85)
at com.fasterxml.jackson.module.scala.introspect.ScalaAnnotationIntrospector$$anonfun$1.apply(ScalaAnnotationIntrospectorModule.scala:85)
at scala.PartialFunction$$anonfun$apply$1.applyOrElse(PartialFunction.scala:247)
at scala.PartialFunction$$anonfun$runWith$1.apply(PartialFunction.scala:141)
at scala.PartialFunction$$anonfun$runWith$1.apply(PartialFunction.scala:140)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at scala.collection.TraversableLike$class.collect(TraversableLike.scala:271)
at scala.collection.mutable.ArrayOps$ofRef.collect(ArrayOps.scala:186)
at com.fasterxml.jackson.module.scala.introspect.ScalaAnnotationIntrospector$$anonfun$4.apply(ScalaAnnotationIntrospectorModule.scala:98)
at com.fasterxml.jackson.module.scala.introspect.ScalaAnnotationIntrospector$$anonfun$4.apply(ScalaAnnotationIntrospectorModule.scala:97)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
at scala.collection.mutable.ArrayOps$ofRef.flatMap(ArrayOps.scala:186)
at com.fasterxml.jackson.module.scala.introspect.ScalaAnnotationIntrospector$.hasCreatorAnnotation(ScalaAnnotationIntrospectorModule.scala:97)
at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.hasCreatorAnnotation(AnnotationIntrospectorPair.java:709)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addCreatorParam(POJOPropertiesCollector.java:486)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addCreators(POJOPropertiesCollector.java:451)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collectAll(POJOPropertiesCollector.java:307)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getPropertyMap(POJOPropertiesCollector.java:267)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getProperties(POJOPropertiesCollector.java:159)
at com.fasterxml.jackson.databind.introspect.BasicBeanDescription._properties(BasicBeanDescription.java:144)
at com.fasterxml.jackson.databind.introspect.BasicBeanDescription.findProperties(BasicBeanDescription.java:219)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:299)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:183)
at io.swagger.scala.converter.SwaggerScalaModelConverter.resolve(SwaggerScalaModelConverter.scala:71)
at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:100)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:234)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:183)
at io.swagger.scala.converter.SwaggerScalaModelConverter.resolve(SwaggerScalaModelConverter.scala:71)
at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:100)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:159)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:110)
at io.swagger.scala.converter.SwaggerScalaModelConverter.resolveProperty(SwaggerScalaModelConverter.scala:55)
at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:80)
at io.swagger.converter.ModelConverters.readAsProperty(ModelConverters.java:58)
at play.modules.swagger.PlayReader.parseMethod(PlayReader.java:487)
at play.modules.swagger.PlayReader.read(PlayReader.java:139)
at play.modules.swagger.PlayReader.read(PlayReader.java:63)
at play.modules.swagger.PlayReader.read(PlayReader.java:57)
at play.modules.swagger.ApiListingCache$$anonfun$listing$1.apply(ApiListingCache.scala:17)
at play.modules.swagger.ApiListingCache$$anonfun$listing$1.apply(ApiListingCache.scala:11)
at scala.Option.orElse(Option.scala:289)
at play.modules.swagger.ApiListingCache$.listing(ApiListingCache.scala:11)
at play.modules.swagger.SwaggerPluginImpl.<init>(SwaggerPlugin.scala:164)
at play.modules.swagger.SwaggerPluginImpl$$FastClassByGuice$$de7219b8.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
... 35 common frames omitted
@Tvaroh Looks like a bug in Jackson, this is not the right syntax to define a PartialFunction https://github.com/FasterXML/jackson-module-scala/blob/master/src/main/scala/com/fasterxml/jackson/module/scala/introspect/ScalaAnnotationIntrospectorModule.scala#L85
1.6.0 has been released, closing this issue accordingly, and moving @Tvaroh issue dicussion to #150
Play 2.6 has been released. It would be great to support it as well.