Writing backend without good API documentation - bad practice. Now I use spring kotlin + RestDocs and want to see that ktor in the future have same ability.
Description: Spring REST Docs helps you to document RESTful services. It combines hand-written documentation written with Asciidoctor and auto-generated snippets produced with Spring MVC Test.
Writing unit tests for testing api and simultaneously generate json payloads and descriptions - is very good approach to have up2date documentation.
Additionally RestAuto docs can help for using jdoc for automatically describing fields in json payloads.
So question:
Does ktor have any plans to make possible to generate Json’s body with payload descriptions via unit test like in Spring Rest Docs?
Thanks!
👍 1
🤔 1
r
rocketraman
03/27/2018, 4:38 AM
Why not just use Spring REST docs? I'm pretty sure you could use the REST-assured URI to connect to and document ktor endpoints.
n
Nail Gilaziev
03/27/2018, 5:13 AM
Hm. Thanks for advice. I never touched the REST Assured so I do not think that it possible. Now I will try
r
rocketraman
03/27/2018, 2:18 PM
Please let me know how it goes!
rocketraman
03/29/2018, 1:44 PM
@Nail Gilaziev Before this thread is lost to Slack's /dev/null, how did it go?
n
Nail Gilaziev
03/30/2018, 12:31 PM
My knowledge for now is next:
Rest Assured can be used for testing ktor endpoints.
But spring rest docs is available for spring only. So, maybe I can write unit tests in separate spring project - but it a huge lack of abilities