Play Framework 2.4 Update for Swagger-Play2 Plugin. #1144

Closed
ghost opened this Issue Jun 8, 2015 · 11 comments

Comments

Projects
None yet
6 participants
@ghost

ghost commented Jun 8, 2015

The Swagger-Play2 Plugin is currently broken by the Play 2.4 update. I know there is work taking place to move this out to it's own project, but I figured I could help with a stop gap until then. Here is a link to my branch that updates the plugin to work with Play 2.4.

https://github.com/mikalveli/swagger-core/tree/1.3.12-play2.4

@bytesandwich

This comment has been minimized.

Show comment
Hide comment
@bytesandwich

bytesandwich Jun 10, 2015

@mikalveli are you keeping your fork as a dependency from maven local?

@mikalveli are you keeping your fork as a dependency from maven local?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jun 10, 2015

I am, we're just installing to our local repos via sbt publish-local. You just have to change into the modules/swagger-play2 directory and issue the sbt publish-local command. Then just update your sbt dependency version wherever you want to use it to 1.3.12_play24.

git clone https://github.com/mikalveli/swagger-core
cd swagger-core
git checkout 1.3.12-play2.4
cd modules/swagger-play2
sbt publish-local

Then inside your Play projects, update build.sbt so the libraryDependencies has:

"com.wordnik"                    %% "swagger-play2"             % "1.3.12_play24"

Edit: Cleaned up, added list of instructions for example.

ghost commented Jun 10, 2015

I am, we're just installing to our local repos via sbt publish-local. You just have to change into the modules/swagger-play2 directory and issue the sbt publish-local command. Then just update your sbt dependency version wherever you want to use it to 1.3.12_play24.

git clone https://github.com/mikalveli/swagger-core
cd swagger-core
git checkout 1.3.12-play2.4
cd modules/swagger-play2
sbt publish-local

Then inside your Play projects, update build.sbt so the libraryDependencies has:

"com.wordnik"                    %% "swagger-play2"             % "1.3.12_play24"

Edit: Cleaned up, added list of instructions for example.

@cablegunmaster

This comment has been minimized.

Show comment
Hide comment
@cablegunmaster

cablegunmaster Jun 10, 2015

mikalveli, i'm trying to recreate what you did, because im updating Play to 2.4 as well, with my swagger-core.

  1. I clone your repository. Esentially downloading the files in a folder. like D:\Swagger-core
  2. I go to the swagger-core folder.
  3. I checkout the folder into my local repository of my pc? ( git local). Create my own repository for this?
  4. I use the sbt publish-local command to attach the repository with my play framework?

I don't understand step 3 checking out the module on the local pc.
'1.3.12-play2.4' != '1.3.12_play24'

None the less happy to know that 2.4 is going to be supported with swagger!

mikalveli, i'm trying to recreate what you did, because im updating Play to 2.4 as well, with my swagger-core.

  1. I clone your repository. Esentially downloading the files in a folder. like D:\Swagger-core
  2. I go to the swagger-core folder.
  3. I checkout the folder into my local repository of my pc? ( git local). Create my own repository for this?
  4. I use the sbt publish-local command to attach the repository with my play framework?

I don't understand step 3 checking out the module on the local pc.
'1.3.12-play2.4' != '1.3.12_play24'

None the less happy to know that 2.4 is going to be supported with swagger!

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jun 10, 2015

Hey @cablegunmaster, the command "git checkout 1.3.12-play2.4" is to switch to the branch where I pushed my modifications in the forked repo. Once you change over to the 1.3.12-play2.4 branch with the git checkout command, you will have the modules/swagger-play2 directory where you will navigate to in order to issue the sbt publish-local command.

ghost commented Jun 10, 2015

Hey @cablegunmaster, the command "git checkout 1.3.12-play2.4" is to switch to the branch where I pushed my modifications in the forked repo. Once you change over to the 1.3.12-play2.4 branch with the git checkout command, you will have the modules/swagger-play2 directory where you will navigate to in order to issue the sbt publish-local command.

@cablegunmaster

This comment has been minimized.

Show comment
Hide comment
@cablegunmaster

cablegunmaster Jun 10, 2015

@mikalveli I got the part fixed with checkout and clone :). Thx!!!!
the publish-local command worked after figuring out how it works. now only to resolve the Swagger update errors ^^!

"URI has an authority component"

Windows users: build.scala replace 'file://' 'file:///' to compensate for the location URI error the SBT creates.

Also don't forget to add the local SBT repository in your build.sbt:
"resolvers += Resolver.mavenLocal"

@mikalveli I got the part fixed with checkout and clone :). Thx!!!!
the publish-local command worked after figuring out how it works. now only to resolve the Swagger update errors ^^!

"URI has an authority component"

Windows users: build.scala replace 'file://' 'file:///' to compensate for the location URI error the SBT creates.

Also don't forget to add the local SBT repository in your build.sbt:
"resolvers += Resolver.mavenLocal"

@truman-misfit

This comment has been minimized.

Show comment
Hide comment
@truman-misfit

truman-misfit Jun 12, 2015

@mikalveli I got a strange error when I follow your steps:

type ApiHelpController is not a member of package controllers

I figure out that you define ApiHelpController as a Object instead of Class which causes the compilation error. So I change the ApiHelpController to Class and it looks good to me. Have I missed something important?

@mikalveli I got a strange error when I follow your steps:

type ApiHelpController is not a member of package controllers

I figure out that you define ApiHelpController as a Object instead of Class which causes the compilation error. So I change the ApiHelpController to Class and it looks good to me. Have I missed something important?

@truman-misfit

This comment has been minimized.

Show comment
Hide comment
@truman-misfit

truman-misfit Jun 13, 2015

@mikalveli I got the problem and fixed it. I think the compilation error was caused by the routesGenerator in my build.sbt file. Play 2.4, by default, generates a dependency injected router, unlike previously, when it used a static router.

@mikalveli I got the problem and fixed it. I think the compilation error was caused by the routesGenerator in my build.sbt file. Play 2.4, by default, generates a dependency injected router, unlike previously, when it used a static router.

@matiwinnetou

This comment has been minimized.

Show comment
Hide comment

I ported 1.3.12 to Play 2.4 here:

https://github.com/matiwinnetou/swagger-play24

@Ciantic

This comment has been minimized.

Show comment
Hide comment
@Ciantic

Ciantic Jul 1, 2015

Is there plans to support play in the core? I know that the Readme says:

Future milestone releases will add support for plain Servlets and Play Framework.

But it's been there probably for ages. I'm now trying this @matiwinnetou's implementation.

Ciantic commented Jul 1, 2015

Is there plans to support play in the core? I know that the Readme says:

Future milestone releases will add support for plain Servlets and Play Framework.

But it's been there probably for ages. I'm now trying this @matiwinnetou's implementation.

@webron

This comment has been minimized.

Show comment
Hide comment
@webron

webron Jul 5, 2015

Member

@Ciantic - there are plans for it, either directly in code or as a separate project. Can't say when though.

Member

webron commented Jul 5, 2015

@Ciantic - there are plans for it, either directly in code or as a separate project. Can't say when though.

@webron

This comment has been minimized.

Show comment
Hide comment
@webron

webron Jul 13, 2015

Member

Thanks for the great work everyone. I'll close this issue for now. For progress on the Play module, please follow #918.

Member

webron commented Jul 13, 2015

Thanks for the great work everyone. I'll close this issue for now. For progress on the Play module, please follow #918.

@webron webron closed this Jul 13, 2015

@lcamilo15 lcamilo15 referenced this issue in swagger-api/swagger-play Sep 10, 2015

Merged

Play 2.4 Enhancement #8

@webron webron referenced this issue in swagger-api/swagger-play Sep 13, 2015

Closed

I don't found swagger-play2 1.3.13 in maven repositories #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment