Skip to content

Commit

Permalink
fixes #69 and adds monospace font for textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaffioletti committed Jan 17, 2015
1 parent 9f190a7 commit 393bfc0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
Expand Up @@ -27,24 +27,24 @@ public void testTemplate() throws JsonGenerationException, JsonMappingException,
Assert.assertEquals("", template.get("name"));
Assert.assertEquals("", template.get("gender"));
Assert.assertEquals(true, template.get("bool"));
Assert.assertEquals(new ArrayList<>(), template.get("intarrarr"));
Assert.assertEquals(new HashMap<>(), template.get("subObj"));
Assert.assertEquals(new ArrayList<>(), template.get("untypedlist"));
Assert.assertEquals(new ArrayList<>(), template.get("subsubobjarr"));
Assert.assertEquals(new ArrayList<>(), template.get("stringlist"));
Assert.assertEquals(new ArrayList<>(), template.get("stringarrarr"));
Assert.assertEquals(new ArrayList<>(), template.get("integerarr"));
Assert.assertEquals(new ArrayList<>(), template.get("stringarr"));
Assert.assertEquals(new ArrayList<>(), template.get("intarr"));
Assert.assertEquals(new ArrayList<>(), template.get("subobjlist"));
Assert.assertEquals(new ArrayList<>(), template.get("wildcardlist"));
Assert.assertEquals(new ArrayList<>(), template.get("longlist"));
Assert.assertEquals(new ArrayList(), template.get("intarrarr"));
Assert.assertEquals(new HashMap(), template.get("subObj"));
Assert.assertEquals(new ArrayList(), template.get("untypedlist"));
Assert.assertEquals(new ArrayList(), template.get("subsubobjarr"));
Assert.assertEquals(new ArrayList(), template.get("stringlist"));
Assert.assertEquals(new ArrayList(), template.get("stringarrarr"));
Assert.assertEquals(new ArrayList(), template.get("integerarr"));
Assert.assertEquals(new ArrayList(), template.get("stringarr"));
Assert.assertEquals(new ArrayList(), template.get("intarr"));
Assert.assertEquals(new ArrayList(), template.get("subobjlist"));
Assert.assertEquals(new ArrayList(), template.get("wildcardlist"));
Assert.assertEquals(new ArrayList(), template.get("longlist"));
Assert.assertEquals("", template.get("namechar"));
Assert.assertEquals(new HashMap<>(), template.get("map"));
Assert.assertEquals(new HashMap<>(), template.get("mapstringinteger"));
Assert.assertEquals(new HashMap<>(), template.get("mapsubobjinteger"));
Assert.assertEquals(new HashMap<>(), template.get("mapintegersubobj"));
Assert.assertEquals(new HashMap<>(), template.get("mapintegerlistsubsubobj"));
Assert.assertEquals(new HashMap(), template.get("map"));
Assert.assertEquals(new HashMap(), template.get("mapstringinteger"));
Assert.assertEquals(new HashMap(), template.get("mapsubobjinteger"));
Assert.assertEquals(new HashMap(), template.get("mapintegersubobj"));
Assert.assertEquals(new HashMap(), template.get("mapintegerlistsubsubobj"));

System.out.println(mapper.writeValueAsString(template));
}
Expand Down
5 changes: 4 additions & 1 deletion jsondoc-ui-webjar/src/main/resources/jsondoc-ui.html
Expand Up @@ -676,7 +676,10 @@ <h5 style="padding:0px">Request URL</p>
$("#testContent").html(testHTML);
$("#testContent").show();

$("#inputJson").text(JSON.stringify(method.bodyobject.jsondocTemplate, undefined, 2));
// if bodyobject is not empty then put jsondocTemplate into textarea
if(method.bodyobject) {
$("#inputJson").text(JSON.stringify(method.bodyobject.jsondocTemplate, undefined, 2));
}

$("#produces input:first").attr("checked", "checked");
$("#consumes input:first").attr("checked", "checked");
Expand Down
5 changes: 4 additions & 1 deletion jsondoc-ui/src/main/webapp/jsondoc.jsp
Expand Up @@ -768,7 +768,10 @@ table td {
$("#testContent").html(testHTML);
$("#testContent").show();
$("#inputJson").text(JSON.stringify(method.bodyobject.jsondocTemplate, undefined, 2));
// if bodyobject is not empty then put jsondocTemplate into textarea
if(method.bodyobject) {
$("#inputJson").text(JSON.stringify(method.bodyobject.jsondocTemplate, undefined, 2));
}
$("#produces input:first").attr("checked", "checked");
$("#consumes input:first").attr("checked", "checked");
Expand Down

0 comments on commit 393bfc0

Please sign in to comment.