TS DTO generated from Java DTO which implements Iterable looses other fields

Hello.
There is Java DTO (it comes from 3rd part library, I cant modify it directly):

public class Test implements Iterable<String> {

	@JsonProperty("items")
	public List<String> items;

	@JsonProperty("batch_error")
	public final int batchError;

	public Test(
			@JsonProperty("items")
			List<String> items,
			@JsonProperty("batch_error")
			int batchError
	) {
		this.items = items != null ? items : Collections.emptyList();
		this.batchError = batchError;
	}//new

	@Override
	public Iterator<String> iterator() {
		return len(items) > 0
				? items.iterator()
				: Collections.emptyListIterator();
	}
}

And this is TS generated type for endpoint method:

Promise<Array<string | undefined>>

As you can see, TS version is just an array, field “batch_error” is lost.
Is it possible to solve it? Vaadin Hilla 24

Create a DTO yourself that does not implement Iterable.

The real DTO is huge and more complex. Creating same DTO is also not the best solution

If using a delegate DTO is not an option, then you may have to modify the endpoint generation or config. Never did that myself, so not sure if it will help.

Maybe these pages help, but this is advanced functionality of Hilla and might be even more complicated then the variant of Knoobie.

https://vaadin.com/docs/latest/hilla/reference/type-conversion

https://vaadin.com/docs/latest/hilla/reference/endpoint-generator