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

Tests for the Slate samples are failing. #339

Closed obviam closed 7 years ago

obviam commented 7 years ago

When running the test in the Slate sample project, some tests are failing.

ApiDocumentation.indexExample() for example is failing with

org.springframework.restdocs.snippet.SnippetException: The following parts of the payload were not documented:
{
  "_links" : {
    "tags" : {
      "href" : "http://localhost:8080/tags"
    },
    "notes" : {
      "href" : "http://localhost:8080/notes"
    },
    "profile" : {
      "href" : "http://localhost:8080/profile"
    }
  }
}

It happens when validating the responseFields

responseFields(fieldWithPath("_links").description("Links to other resources"))

Using subsectionWithPath instead of fieldWithPath fixes the test.

Affected tests: indexExample() notesListExample() noteGetExample() tagsListExample() tagGetExample()

in the ApiDocumentation.java rest-notes-slate project.

wilkinsona commented 7 years ago

Oops. Thanks. The dangers of not having proper CI for the sample that needs Ruby… This should have been changed as part of https://github.com/spring-projects/spring-restdocs/commit/cbd96f301d87078b01c6852723bf0861bdfbca11