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

Domino rest should not generate code for @GwtIncompatible #49

Open
natros opened this issue Jul 8, 2020 · 5 comments
Open

Domino rest should not generate code for @GwtIncompatible #49

natros opened this issue Jul 8, 2020 · 5 comments
Assignees
Milestone

Comments

@natros
Copy link

natros commented Jul 8, 2020

Domino rest should not generate code for @GwtIncompatible, so I can exclude jaxrs-super and use jakarta.ws.rs:jakarta.ws.rs-api that contains javax.ws.rs.core.Response

implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
compileOnly('org.dominokit:domino-rest-gwt:1.0-rc.4-SNAPSHOT') {
    exclude group: 'org.dominokit', module: 'jaxrs-super'
}
@RequestFactory
@Path("/users")
@Produces("application/json")
@Consumes("application/json")
public interface UserResource {
  //...
  @GET
  @Produces("application/pdf")
  @GwtIncompatible
  Response downloadPdf();
}
@vegegoku vegegoku self-assigned this Jul 8, 2020
@vegegoku vegegoku added this to the 1.0 milestone Jul 8, 2020
@vegegoku
Copy link
Member

vegegoku commented Jul 8, 2020

I would assume that Response int the sample above is from jakarta package and you want to avoid GWT compilation issue here.
is this because you want Response support and you want to download a PDF using domino-rest?

@natros
Copy link
Author

natros commented Jul 8, 2020

afaik oracle forbids names that contains java or javax and jakarta is the replacement. instead of javax.ws.rs:jsr311-api, javax.ws.rs:javax.ws.rs-api I use jakarta.ws.rs:jakarta.ws.rs-api.

I want to avoid gwt compiling javax.ws.rs.core.Response and I don't want to use domino-rest to download the pdf. The pdf is download with a link.

That's what I do with restygwt to share the rest api between the client and the server. For UserResource in the shared module I have a UserResourceImpl that implements UserResource

thanks.

@vegegoku
Copy link
Member

vegegoku commented Jul 8, 2020

Domino-rest generate the client for the JVM too, so if we dont generate from methods marked with @GwtIncompatible we will break the generated client for all other targets that are not GWT, so if instead we mark the generated code as @GwtIncompatible will that be sufficient?

@natros
Copy link
Author

natros commented Jul 8, 2020

I tried inserting the @GwtIncompatible in UserResourceFactory but the GWT compiler always complains about the missing javax.ws.rs.core.Response. It seems to work well for interfaces but not implementation. I found a better solution that worked without any @GwtIncompatible annotation. I just created an empty Response class inside the package javax.ws.rs.core with a .gwt.xml file.

Feel free to close this issue.
Thanks.

@vegegoku
Copy link
Member

vegegoku commented Jul 9, 2020

#45

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