spring-projects / spring-restdocs

Test-driven documentation for RESTful services
https://spring.io/projects/spring-restdocs
Apache License 2.0
1.16k stars 736 forks source link

Limitation for response data #236

Closed varpa89 closed 8 years ago

varpa89 commented 8 years ago

Some requests return array of data items and usually there is more data than we should to put in our documentation because it will be unreadable and heavy documentation.

Is it possible to reduce response data if the method does not allow to use limit parameter?

In addition it will be great if spring-restdocs could generate 'View result' blocks like this

wilkinsona commented 8 years ago

There are a couple of existing options that might work here:

  1. Mock something out in the service to limit that amount of data that's returned.
  2. Use a preprocessor to change the response prior to it being documented. There's a bit of information in the documentation about writing your own preprocessor

Does either of these fit your needs?

The "View result" blocks are an Asciidoctor thing, rather than a REST Docs thing. You can learn more about them here and in the pages linked to from that discussion.

varpa89 commented 8 years ago

Thanks for helping. I think this options are ok. I'l try to use one of them and write tutorial =)

wilkinsona commented 8 years ago

Thanks for following up