From aeb70f30afbae7c0e0449ab726d65d57a0a6faca Mon Sep 17 00:00:00 2001 From: Edgar Espina Date: Sat, 21 Oct 2017 14:00:33 -0300 Subject: [PATCH] jackson 2.9.2 #911 --- .../src/main/java/org/jooby/apitool/raml/Raml.java | 4 +++- .../src/test/java/org/jooby/apitool/RamlTest.java | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/jooby-apitool/src/main/java/org/jooby/apitool/raml/Raml.java b/modules/jooby-apitool/src/main/java/org/jooby/apitool/raml/Raml.java index 7fc64652c6..8ba5cc75bd 100644 --- a/modules/jooby-apitool/src/main/java/org/jooby/apitool/raml/Raml.java +++ b/modules/jooby-apitool/src/main/java/org/jooby/apitool/raml/Raml.java @@ -487,7 +487,9 @@ private RamlType define(final String type, final Model model) { } })); definition = object; - object.setExample(example); + if (example.values().stream().filter(Objects::nonNull).count() > 0) { + object.setExample(example); + } } return definition; } diff --git a/modules/jooby-apitool/src/test/java/org/jooby/apitool/RamlTest.java b/modules/jooby-apitool/src/test/java/org/jooby/apitool/RamlTest.java index 56af6457b4..893732a575 100644 --- a/modules/jooby-apitool/src/test/java/org/jooby/apitool/RamlTest.java +++ b/modules/jooby-apitool/src/test/java/org/jooby/apitool/RamlTest.java @@ -60,8 +60,6 @@ public void shouldWorkWithUUID() throws Exception { + " type: object\n" + " properties:\n" + " id?: UUID\n" - + " example:\n" - + " id: null\n" + "/api:\n" + " /entry:\n" + " /{id}:\n" @@ -103,7 +101,6 @@ public void shouldUseCustomType() throws Exception { + " bar: string\n" + " UUID:\n" + " type: object\n" - + " example: {}\n" + "/api:\n" + " /entry:\n" + " /{id}:\n"