I'm a Java Spring developer who (unfortunately) currently working on a Python Django project. As you may know, Spring REST Docs
is a library that allows documenting API within integration (API) tests. Here is a sample API testing code using spring integration testing tools and spring rest docs:
this.mockMvc.perform(get("/user/5").accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andDo(document("index",
responseFields(
fieldWithPath("contact.email")
.description("The user's email address"),
fieldWithPath("contact.name").description("The user's name"))));
As you may see, the big benefit of using Spring REST Docs is combining API tests with the API documentation. In this manner, developers will not forget to write/update an endpoint's documentation and, of course, it prevents duplicate code.
There are plenty of awesome API testing tools as well as hundreds of awesome API documentation tools. But I could not find any tool that combines API testing with API documenting, except a few commercial tools like Postman which has their own limitations. Is there any open-source (language-agnostic or language-specific) tool similar to Spring REST Docs?
Aucun commentaire:
Enregistrer un commentaire