PathParametersSnippet extends AbstractParameterSnippet<PathVariable> { public PathParametersSnippet failOnUndocumentedParams(boolean failOnUndocumentedParams) { return new PathParametersSnippet(failOnUndocumentedParams); } PathParametersSnippet();  PathParametersSnippet(boolean failOnUndocumentedParams); PathParametersSnippet failOnUndocumentedParams(boolean failOnUndocumentedParams); @Override String getHeaderKey(Operation operation);  }
@Test public void failOnUndocumentedParams() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("addItem", Integer.class, String.class, int.class, String.class, Optional.class); initParameters(handlerMethod); thrown.expect(SnippetException.class); thrown.expectMessage( "Following path parameters were not documented: [id, subid, partId, yetAnotherId, optionalId]"); new PathParametersSnippet().failOnUndocumentedParams(true).document(operationBuilder .attribute(HandlerMethod.class.getName(), handlerMethod) .attribute(JavadocReader.class.getName(), javadocReader) .attribute(ConstraintReader.class.getName(), constraintReader) .build()); }