Hi! I have question about how JSONResult (or specifically JSONWriter) handles Iteratable objects. It treats them as having no other methods than containing other objects. But most Iteratable objects have more to them than that, but those methods are impossible to output as JSON.
In JSONWriter.process() (line 155): } else if (object instanceof Iterable) { this.array(((Iterable) object).iterator(), method); The array() method just adds the objects returned from the iterator. But what if we need some other property? Is there a way to do this? More specifically, we have a PaginatedCollection used for paging - it's an Iteratable, but also contains methods like: getTotalSize() getNextPage() getLastPage() and so on. Any ideas on how to serialize such an object to JSON? Shouldn't JSONWriter treat an Iteratable as a bean with something like entries added to it? Like this: paginatedCollection : { totalSize : 100, nextPage : 5, lastPage : 10, entries: [{item :1}, item : 2}] } Regards Peter Björkman