eclipse-vertx / eclipse-vertx/vertx-codegen

Abstract data object support in params

Aperta
#80 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
111
Fork
89
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Data object params needs to be a plain class because it needs to be reconstructed from Json format (for example in JavaScript or Groovy). This is now not possible because the code generator will not know which data object to create.

We could work around this by having a static method `fromJson` returning an instance of that object that would be invoked by the generator, delegating the responsibility of creating the right instance to this method. This method could either use some hard coded mechanism or something else.

For example:

```
@DataObject
public abstract class AuthOptions {
public static AuthOptions fromJson(JsonObject object) {
...
}
}
```

This would allow for example the use of a common data object in service proxies or configuration.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.