-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support play for java and scala server. #3057
Comments
@clasnake we would definitely welcome contribution for a play framework server stub generator. Here is a good starting point: https://github.com/swagger-api/swagger-codegen/wiki/How-to-add-a-generator-for-a-new-language-or-framework |
@wing328 I'll take a look at this one. And shall we add label Server: Scala as well? |
@wing328 Well I see the play integration at https://github.com/swagger-api/swagger-play as a separate repo and https://github.com/zalando/play-swagger to generate play code from the spec. So I guess no need to add it into swagger-codegen? |
cc @ePaul |
@wing328 Thanks for pinging me. Although that project (zalando/play-swagger) is from my company, I didn't use it until now (my team is using neither Play nor Scala). Looking at the README, it seems to have a bit different approach than Swagger-Codegen. It is integrated in the Scala Build tool, generating both managed code (i.e. code which is generated in the target folder, which you shouldn't edit) and unmanaged code (code which you can edit, and which might get modified later by the plugin, keeping your edits). I'm not sure if the latter one would be possible at all with Swagger-Codegen's current architecture. (Swagger-Play seems to be the Scala/Play version corresponding to Java's Swagger-annotations, generating Swagger/OpenAPI from Play code. This would be the inverse approach to play-swagger, though both names should be swapped to describe what they are doing.) @clasnake Please check if the play-swagger generator works for you (and report any issues back to that repository's tracker). If it doesn't, having more ways to support end-to-end type safety (which is one of the reasons I want to have Swagger-generation) is always good, so you are welcome to contribute a generator here (though I can't really comment much on it, knowing Scala only very superficially – I don't like the syntax). |
Hi, is there something started for play framework codegen export? We would be interested in such feature and maybe we could contribute if something is already started. The alternative stated above are good but don't use the codegen and don't follow the process we would want to use. Let me know! Thanks |
@JFCote there's a sample for Swagger Play framework sample app (Petstore) at https://github.com/swagger-api/swagger-play-sample-app (which was created 5 years ago) One approach is to reverse engineer the output (the sample play app) back into the mustache template. Let me know if you're interested in the work and we can work together to create the Play generator. |
@wing328 : I'm VERY new to Swagger, I still need to understand a lots of thing before doing something like that. But right now I can tell you:
I need to learn a bit more about swagger, I'll keep you updated. |
Let's start with the latest stable version (2.5.10) to being with.
Let's start with Java 😄
An example is https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/Java/pojo.mustache#L79, which will be used by the Java generator when generating the models and |
Description
Seems no support for play now.
Shall we support play for java and scala server, so that server-side code based on the play framework can be auto-generated according to the rest spec.
The text was updated successfully, but these errors were encountered: