konsoletyper/teavm-flavour

@Context parameters not ignored

Opened this issue · 4 comments

When RESTClient builds a proxy for a web service, it should not include @ Context parameters, since those will be injected by the container.

Instead, it generates warnings:
[ERROR] Multiple candidates for message body: $0 and $2

I don't think that's in project's scope. Is @Context parameter about DI? I'm not going to implement DI in Flavour. In this document all supported annotations are enumerated.

Could Flavour ignore injected properties, at least? Since they are part of the interface method signature, they seem to be causing problems. Flavour thinks they should be passed from the caller, but they won't be -- they will get added server-side.

Why do you need this @Context annotation? What are you going to inject? Can't you inject it into object via constructor rather than passing the service through RPC method? IMO, it's a very bad idea. You claim some service in interface between client and server, but when you call this interface, you should always pass null.

That makes sense. I will look to restructure so the interface has only the fields expected from the caller.