Test-driven documentation with Spring REST Docs - Andy Wilkinson @ Spring I/O 2016

preview_player
Показать описание
Spring I/O 2016 - 19 -20 May Barcelona

RESTful APIs are eating the world, yet all too often the documentation can cause indigestion for the APIs' developers and their users. Developers have to deal with annotation overload, repetition, and an unpleasant writing environment. Users are then left with documentation that's inaccurate and difficult to use. It doesn't have to be this way.

This talk will introduce Spring REST Docs and its test-driven approach to RESTful API documentation. We'll look at how it combines the power of Asciidoctor and your integration tests to produce documentation that's accurate and easy-to-read, while keeping your code DRY and free from annotation overload. We'll also look at some of the features that are new in Spring REST Docs 1.1, including support for REST Assured and Markdown.
Рекомендации по теме
Комментарии
Автор

A very comprehensive and lucid tutorial. Really helped me in clearing a lot of concepts. Thanks :)

Sauveer
Автор

7:58 easier to write
10:05
13:24 example mock test code
13:38 MockMvc gives you a way of testing your controllers without actually firing up a servlet container. So rather than dealing with actual http requests and http responses, you are dealing with Mock Http requests and Mock Http responses.
18:33 snippets
20:45 Http response snippets
21:07 Response fields snippets
21:36 Asciidoctor
21:41 mvc mock tests produce the snippets
23:35 Other Snippets
23:41 *Hypermedia links
23:53 Hypermedia gives you links in your responses
24:18 2 benifits of hypermedia links
26:28 demo
31:05 where the asciidoc file is located
32:34 the generated html
33:01 pom.xml
33:52 What else is new in 1.1
37:42 relaxed snippets

ruixue
Автор

That's a very nice tutorial, even 7 years later. Currently I'm trying to weigh out the benefits of using openapi vs test driven documentation, and I'm deffinitely willing to give Spring REST docs a try.

michaelmihov