Sometimes we can bypass Agrest runtime to generate a quick DataResponse around some POJOs:
return DataResponse.of(200, List.of(o));
Currently this would not render properly, because the default encoder would be the GenericEncoder. Instead let's make DataResponseEncoder the default.
While we are at it, let's refactor factory methods into a builder that would allow to distinguish between the main encoder and individual element encoder in the response
Sometimes we can bypass Agrest runtime to generate a quick DataResponse around some POJOs:
Currently this would not render properly, because the default encoder would be the
GenericEncoder
. Instead let's makeDataResponseEncoder
the default.While we are at it, let's refactor factory methods into a builder that would allow to distinguish between the main encoder and individual element encoder in the response