-
Notifications
You must be signed in to change notification settings - Fork 6k
[Scala][Finch] Add Finch generator #3905
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
Conversation
8426d6b to
3a5f122
Compare
|
UPDATE: rebased on the latest master to resolve merge conflicts |
|
Have fetched the feature branch and continued with the work now. |
|
I just saw this. I'll pull it and take a look |
|
@clasnake @wing328 I checked this out, and made a few changes on my fork's branch: https://github.com/jimschubert/swagger-codegen/tree/jrs-finch-generator In the branch, I have fixes for the casecodecX counts required for the parameter count in models via extensions. Also:
There are a few other things to fix, mostly parameter inputs, but I think it's close. |
|
@jimschubert 👍 please submit a PR against my branch so that I can include the enhancements you've made. |
|
@wing328 sure, I opened a PR against your branch. Have you used hub (https://hub.github.com/)? I believe you could just do the following with hub: Then again, with the PR I opened you could apply the changes directly to your working branch: |
|
Lol. I just saw the merge commit in my email and noticed one of the messages said "Removed Finatra stuff". Should have said Scalatra. I use Finatra at work, and typed it out of habit. |
|
@jimschubert that's fine. Don't worry about the commit message. Is this ready for a beta release? |
|
@wing328 my PR against yours was missing a couple things. The main one was passing parameters correctly to the verb method. As it is now, it shouldn't compile. I could look at it a little more later. |
* change api and ApiClient to return cancellable NSURLSessionTasks instead of NSNumber * define a configuration protocol for custom configurations, which can be passed to api clients instead of a global configuration, provide a default implementation with a singleton option * integrate a workaround for a current JSONModel concurrency bug * update to new ISO8601 pod * add missing call to super * integrate new templates into codegen * updates documentation templates * updates petstore objc generated code * fixes objc client tests
This puts parameters (input/output) in the right format. Currently, this is done in the generator class using vendorExtensions, but should be refactored to imported templates to clean up. Previous commits of the server generator output to appropriate models/api directories. I've made no changes to this logic, but code currently generates to the root scala package directory. This will need to be fixed. There's also an issue with circe's and Option[Date] in the Order type. This issue will need to be resolved. As well, there's some unused imports to clean up. Initial implementation lacks support for custom imports, type mappings, etc.
537f93f to
ac32ceb
Compare
|
Targetting swagger 2.x or 3.x? |
|
Swagger Codegen relies on Swagger Parser (another git project) to parse the Swagger/OpenAPI spec 2.x. I believe the support for OpenAPI 3.x in Swagger Parser is still in progress. |
|
@wing328 @jimschubert This change (specifically the build.sbt with the dependencies change) seems to have broken the Travis CI build (see #4910 for the updated samples and the Travis build job linked from there). I don't really now anything about SBT, so I can't really fix this. |
|
@ePaul it looks like |
* Update samples for Scalatra after 2.2.2. * [scalatra] Revert changes to build.sbt Changes were made in conjunction with the new finch generator. This reverts those changes to Scalatra's previous build.sbt. * Update scalatra samples again after revert of part of #3905.
* Update samples for Scalatra after 2.2.2. * [scalatra] Revert changes to build.sbt Changes were made in conjunction with the new finch generator. This reverts those changes to Scalatra's previous build.sbt. * Update scalatra samples again after revert of part of swagger-api#3905.
* Feature/objc tasks 2.3.0 (swagger-api#3522) * change api and ApiClient to return cancellable NSURLSessionTasks instead of NSNumber * define a configuration protocol for custom configurations, which can be passed to api clients instead of a global configuration, provide a default implementation with a singleton option * integrate a workaround for a current JSONModel concurrency bug * update to new ISO8601 pod * add missing call to super * integrate new templates into codegen * updates documentation templates * updates petstore objc generated code * fixes objc client tests * [ObjC] Add version define and share default headers of each client * add finch generator and resource * update license, add errros * Fix problem with multitheard api client * fix some errors for finch * [finch] Remove license header * [finch] Remove finatra stuff, fix a few issues * WIP: Finch server generator * [finch] WIP: server generator impl This puts parameters (input/output) in the right format. Currently, this is done in the generator class using vendorExtensions, but should be refactored to imported templates to clean up. Previous commits of the server generator output to appropriate models/api directories. I've made no changes to this logic, but code currently generates to the root scala package directory. This will need to be fixed. There's also an issue with circe's and Option[Date] in the Order type. This issue will need to be resolved. As well, there's some unused imports to clean up. Initial implementation lacks support for custom imports, type mappings, etc. * [finch] Update api/model package and imports * [finch] Explicit import/type mappings * [finch] Regenerate example
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch for breaking (non-backward compatible) changes.Description of the PR
Still work in progress. Here are some of the errors when running
sbt test(I'll do a rebase later to resolve the merge conflicts)