Open simasch opened 1 year ago
It was introduced in https://github.com/vaadin/flow/pull/11648 in order to support returning Page
from endpoints somehow. The idea back then was that a simple array result is enough.
The old generator was struggling to emit the Page
directly, as it is coming from a dependency, which source is not available, and reflection support was lacking.
Since this is unexpected, we could improve this for the new generator, and the old one could use a better (more similar to Page) internal representation as a workaround.
Until this is fixed, please use a DTO as a workaround.
Hm-m, actually it would be preferable to fix this issue in a way that keeps the same behavior in the old and new generator. I’m marking this as a blocker, so that it is fixed before the 2.0 major release.
After one more take on this, it turns out that generic entities such as Page were not supported. Fixing this issue is blocked by https://github.com/vaadin/hilla/issues/579
Sadly it is not possible to fix in the 2.0 beta at the moment. Let us revisit this after adding support for generic entities.
I am facing the same problem. Looks like it is not fixed yet. Hope to see this gets fixed in the future. As a workaround, I am also using a Custom DTO for page objects.
+1 for fixing this.
I have this endpoint method:
This generates:
As you can see the return type Page is ignored.
Why is that? If I would like the result as Page I cannot do that and have to create my own result type .