Skip to content

Conversation

@wing328
Copy link
Contributor

@wing328 wing328 commented Sep 29, 2016

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

Still work in progress. Here are some of the errors when running sbt test

[error] /Users/williamcheng/Code/jul2016/swagger-codegen/samples/server/petstore/finch/src/main/scala/endpoint.scala:270: identifier expected but ']' found.
[error]   def logoutUser(db: PetstoreDb): Endpoint[] =
[error]                                            ^
[error] /Users/williamcheng/Code/jul2016/swagger-codegen/samples/server/petstore/finch/src/main/scala/endpoint.scala:279: ']' expected but ';' found.
[error]   def updateUser(db: PetstoreDb): Endpoint[] =
[error] ^
[error] /Users/williamcheng/Code/jul2016/swagger-codegen/samples/server/petstore/finch/src/main/scala/endpoint.scala:279: identifier expected but ']' found.

(I'll do a rebase later to resolve the merge conflicts)

@wing328
Copy link
Contributor Author

wing328 commented Sep 30, 2016

UPDATE: rebased on the latest master to resolve merge conflicts

@clasnake
Copy link
Contributor

Have fetched the feature branch and continued with the work now.

@jimschubert
Copy link
Contributor

I just saw this. I'll pull it and take a look

@jimschubert
Copy link
Contributor

@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:

  • sorted API code out
  • removed Scalatra and other unused references
  • cleaned up endpoint.scala
  • provided an service loaded data accessor in place of the PetstoreDb object

There are a few other things to fix, mostly parameter inputs, but I think it's close.

@wing328
Copy link
Contributor Author

wing328 commented Nov 7, 2016

@jimschubert 👍 please submit a PR against my branch so that I can include the enhancements you've made.

@jimschubert
Copy link
Contributor

@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:

git fetch jimschubert
git merge jimschubert/jrs-finch-generator

Then again, with the PR I opened you could apply the changes directly to your working branch:

git am -3 https://github.com/wing328/swagger-codegen/issues/9

@jimschubert
Copy link
Contributor

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.

@wing328
Copy link
Contributor Author

wing328 commented Nov 15, 2016

@jimschubert that's fine. Don't worry about the commit message.

Is this ready for a beta release?

@jimschubert
Copy link
Contributor

@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.

wberger and others added 13 commits January 29, 2017 11:45
* 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.
@wing328 wing328 merged commit ae8a123 into swagger-api:master Jan 29, 2017
@schrepfler
Copy link

Targetting swagger 2.x or 3.x?

@wing328
Copy link
Contributor Author

wing328 commented Jan 31, 2017

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 wing328 deleted the finch_generator branch January 31, 2017 15:06
@wing328 wing328 changed the title [WIP][Scala] Finch generator [Scala][Finch] Add Finch generator Feb 21, 2017
@ePaul
Copy link
Contributor

ePaul commented Mar 4, 2017

@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.

@jimschubert
Copy link
Contributor

@ePaul it looks like modules/swagger-codegen/src/main/resources/scalatra/build.sbt was modified by accident. I'll revert those change and open a PR for it shortly.

ePaul pushed a commit to ePaul/swagger-codegen that referenced this pull request Mar 5, 2017
ePaul pushed a commit to ePaul/swagger-codegen that referenced this pull request Mar 5, 2017
wing328 pushed a commit that referenced this pull request Mar 6, 2017
* 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.
spr3nk3ls pushed a commit to spr3nk3ls/swagger-codegen that referenced this pull request Mar 28, 2017
* 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.
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants