Skip to content
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

Unable to generate a Play WS client class #36

Open
fralken opened this issue Jun 8, 2016 · 1 comment
Open

Unable to generate a Play WS client class #36

fralken opened this issue Jun 8, 2016 · 1 comment

Comments

@fralken
Copy link

fralken commented Jun 8, 2016

I'd like to generate a class for Play client like so

class PetStoreClient @Inject() (WS: WSClient) (baseUrl: String) {

but it is not possible:

  • for @Inject() annotation there is no way to define it, maybe the behavior of withCtorFlags should be adapted to support this
  • it is not possible to define multiple withParams for ClassDefs, probably because ClassDefStarthas its own implementation of withParams rather than extending from VparamssStart

Thanks

@tmkontra
Copy link

Not sure if this entirely solves the issue, but I found a possible work-around:

val myClassName = "PetStoreClient"
CLASSDEF(
      myClassName + " @Inject()"
)

returns

class PetStoreClient @Inject()

this doesn't have great ergonomics on multiple param lists, but if you can turn all N-1 parameter lists to their strings and jam them in the "class name" like above, then you can still formulate the final (N) parameter list via .withParams

I'm hoping to look in to adding these functionalities after I get more familiar with the library (Play integration is my use case as well, as I am sure is the case for many others due to its popularity).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants