JacksonResponseFieldSnippet extends AbstractJacksonFieldSnippet { public JacksonResponseFieldSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields) { return new JacksonResponseFieldSnippet(responseBodyType, failOnUndocumentedFields); } JacksonResponseFieldSnippet();  JacksonResponseFieldSnippet(Type responseBodyType, boolean failOnUndocumentedFields); JacksonResponseFieldSnippet responseBodyAsType(Type responseBodyType); JacksonResponseFieldSnippet failOnUndocumentedFields(boolean failOnUndocumentedFields); @Override String getHeaderKey(Operation operation); static final Set<String> SPRING_HATEOAS_CLASSES; static final String REACTOR_MONO_CLASS; static final String REACTOR_FLUX_CLASS; }
@Test public void failOnUndocumentedFields() throws Exception { HandlerMethod handlerMethod = createHandlerMethod("getItem"); thrown.expect(SnippetException.class); thrown.expectMessage("Following response fields were not documented: [field1, field2]"); new JacksonResponseFieldSnippet().failOnUndocumentedFields(true).document(operationBuilder .attribute(HandlerMethod.class.getName(), handlerMethod) .attribute(ObjectMapper.class.getName(), mapper) .attribute(JavadocReader.class.getName(), javadocReader) .attribute(ConstraintReader.class.getName(), constraintReader) .build()); }