eclipse-vertx / eclipse-vertx/vertx-codegen
Extend Map returns to supports more types than basic and json (enums, etc...)
- Vorherrschende Sprache
- Java
- Sterne
- 111
- Forks
- 89
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
The following proxy interface doesn't compile:
``` java
package com.melusyn.gatekeeper.service;
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import java.util.Map;
/**
* The service interface.
*/
@ProxyGen
@VertxGen // Generate the proxy and handler
public interface MyProxyService {
enum MyEnum {
Value1,
Value2,
Value3,
}
void callThatReturnsAMap(String param1, Handler>> handler);
}
```
The compilation fails with the error:
```
type >> is not legal for use for a parameter in proxy
```
However, the documentation says otherwise (https://github.com/vert-x3/vertx-codegen#permitted-types).
> The following set R of types are permitted as return types from any API method:
> [...]
> type java.util.List, java.util.Set or java.util.Map where C contains
> [...]
The method `io.vertx.codegen.ProxyModel.isLegalListSetMapResult` does not check for `Map` type.
Has this been overlooked or this is on purpose? I found an old issue #8 referring to it... But not much was said at that time.
I'm willing to do a PR if the core team feel this is missing and should been implemented.
Beitragsleitfaden
Rechercherichtung
Beginnen Sie bei io.vertx.codegen.ProxyModel.isLegalListSetMapResult und reproduzieren Sie das MyProxyService-Beispiel aus dem Issue. Vergleichen Sie sein Verhalten mit der Dokumentation zu den zulässigen Typen; die Arbeit ist abgeschlossen, wenn die Proxy-Methode Map konsistent mit den dokumentierten unterstützten Typen behandelt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100