org.springframework.restdocs.snippet.SnippetException: Path parameters with the following names were not documented: [bar]

GitHub | embee1981 | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Cannot document path parameters when a URI variable is used for a query parameter

    GitHub | 7 months ago | embee1981
    org.springframework.restdocs.snippet.SnippetException: Path parameters with the following names were not documented: [bar]
  2. 0

    how to write spring-restdocs snippets with MockMultipartFile

    Stack Overflow | 9 months ago | Joseph Wang
    org.springframework.restdocs.snippet.SnippetException: Request parameters with the following names were not found in the request: [file]
  3. 0

    How can I document the cookie using spring-restdoc?

    Stack Overflow | 5 months ago | Pascale Borscia
    org.springframework.restdocs.snippet.SnippetException: Headers with the following names were not found in the request: [Cookie]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    restdocs SnippetException due to HAL "_links" elements from spring-data-rest

    Stack Overflow | 2 months ago | Eric Turley
    org.springframework.restdocs.snippet.SnippetException: The following parts of the payload were not documented: { "_links" : { "self" : { "href" : "https://my-api/item/10" }, "item" : { "href" : "https://my-api/item/10" } } } This is my test code: @Rule public JUnitRestDocumentation restDocs = new JUnitRestDocumentation("target/generated-snippets"); // ... mockMvc = webAppContextSetup(wac) //WebApplicationContext .apply(documentationConfiguration(restDocs) .uris() .withHost("my-api") .withPort(443) .withScheme("https")) .build(); // .... mockMvc.perform(get("/items/{id}", "10")) .andDo(documentation)

    Root Cause Analysis

    1. org.springframework.restdocs.snippet.SnippetException

      Path parameters with the following names were not documented: [bar]

      at org.springframework.restdocs.request.PathParametersSnippet.verificationFailed()
    2. org.springframework.restdocs
      RestDocumentationResultHandler.handle
      1. org.springframework.restdocs.request.PathParametersSnippet.verificationFailed(PathParametersSnippet.java:121)
      2. org.springframework.restdocs.request.AbstractParametersSnippet.verifyParameterDescriptors(AbstractParametersSnippet.java:93)
      3. org.springframework.restdocs.request.AbstractParametersSnippet.createModel(AbstractParametersSnippet.java:70)
      4. org.springframework.restdocs.request.PathParametersSnippet.createModel(PathParametersSnippet.java:67)
      5. org.springframework.restdocs.snippet.TemplatedSnippet.document(TemplatedSnippet.java:64)
      6. org.springframework.restdocs.mockmvc.RestDocumentationResultHandler.handle(RestDocumentationResultHandler.java:104)
      6 frames
    3. Spring TestContext
      MockMvc.perform
      1. org.springframework.test.web.servlet.MockMvc.applyDefaultResultActions(MockMvc.java:195)
      2. org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:163)
      2 frames