-
Notifications
You must be signed in to change notification settings - Fork 179
Upgrade to Play Framework 2.8 #220
base: master
Are you sure you want to change the base?
Conversation
Swagger Play Version | Play Version | Branch | ||
---------------------| ------------ | ------ | ||
3.0.0 | 2.8 | [master](https://github.com/swagger-api/swagger-play/tree/master) | ||
2.0.0 | 2.7 | [play27](https://github.com/swagger-api/swagger-play/tree/play-2.7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assuming branch will be created after this PR is merged...
resolves #213 |
any chance this will be merged soon? |
@targeter cross compilation works great. |
No offence but what are we waiting to merge this? |
ENG-14940: Add Play 2.8 support from swagger-api#220
@tarmath it's not that it is abandoned as much as a capacity problem. I've tried reaching out to a few people in the community to become committers, but unfortunately have managed to get nobody yet. If anyone is interested, feel free to drop me a line (email in profile). |
Can you please merge it asap and release it for public use ? |
Anyone is going to merge this? |
Note that the plugin works fine with Play Framework 2.8 even though this PR is not merged. We have been running on the latest play-swagger release and Play Framework 2.8 for months now without issues. |
Hi @gaeljw, I did exactly what you suggested but I ran into an issue with fasterxml: it's throwing an error while generating the swagger.json because of a cyclic dependency on the StringProperty's readOnly method:
I guess it's because it returns itself. I found a similar unresolved issue on SO: https://stackoverflow.com/questions/62127929/swagger-ui-with-play-framework I wonder why it worked just fine for you. I'm currently on Play 2.8.2 Other verions: |
Hi @tolomaus , you should probably ensure that all Jackson dependencies are the same version (2.10.x, 2.11 doesn't work with Swagger AFAIK) with your build tool |
@gaeljw I was finally able to work around the issue when I forced all fasterxml versions to 2.10.2! Play 2.8.1 works fine out-of-the-box, but for Play 2.8.2 the fasterxml versions are bumped to 2.10.5 and that's when the issues surfaces. I wonder why fasterxml 2.10.5 trips over the cyclic dependency, or rather, why 2.10.2 doesn't ;-) |
Here is a workaround that seems to resolve the cyclic dependency by ignoring the readOnly() method.
|
Hi Webron, I want to help the community and become a committer. P.S.: Merge this commit 🙏🏻 |
I published my fork which cross-compiles for 2.7 and 2.8 // for Play 2.7:
libraryDependencies += "com.github.dwickern" %% "swagger-play2.7" % "3.0.0"
// for Play 2.8:
libraryDependencies += "com.github.dwickern" %% "swagger-play2.8" % "3.0.0" |
Hi All, Any idea when this PR will get merged back to |
Waiting for this merge to start using it! thanks |
@holthauj I ended up creating a java patch which solved a similar problem I had because a dependency is bringing jackson 2.11 to my classpath. Tested with https://github.com/dwickern/swagger-play in play 2.8.7, thanks to @holthauj @dwickern import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.models.properties.AbstractProperty;
import io.swagger.models.properties.Property;
// See https://github.com/swagger-api/swagger-play/pull/220#issuecomment-736987055
public class JavaJacksonPatch {
static {
ObjectMapper mapper = io.swagger.util.Json.mapper();
mapper.addMixIn(AbstractProperty.class, AbstractPropertyMixin.class);
}
public static void init() {
System.out.println("Applying jackson patch");
}
public static abstract class AbstractPropertyMixin {
@JsonIgnore
public abstract Property readOnly();
}
} |
Upgrade to Play Framework 2.8