Skip to content

Commit

Permalink
fix JSON response from preview RDF value command for #38
Browse files Browse the repository at this point in the history
  • Loading branch information
stkenny committed Jan 22, 2020
1 parent b796d43 commit 9786981
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>nl.dtls</groupId>
<artifactId>rdf-extension</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
<packaging>jar</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
try{
base = new URI(baseUri);
}catch(URISyntaxException ex){
respond(response, "{ \"code\" : \"error\", \"message\" : \"Invalie Base URI\" }");
respond(response, "{ \"code\" : \"error\", \"message\" : \"Invalid Base URI\" }");
return;
}
response.setCharacterEncoding("UTF-8");
Expand Down Expand Up @@ -134,6 +134,8 @@ private void respondUriPreview(Project project, JsonGenerator writer, JsonNode r

writer.writeEndObject();

writer.flush();
writer.close();
}


Expand Down Expand Up @@ -168,6 +170,7 @@ private void respondLiteralPreview(Project project, JsonGenerator writer, JsonNo

writer.writeStringField("code", "ok");
} catch (ParsingException e) {
writer.writeEndArray();
writer.writeStringField("code", "error");
writer.writeStringField("type", "parser");
writer.writeStringField("message", e.getMessage());
Expand All @@ -179,6 +182,7 @@ private void respondLiteralPreview(Project project, JsonGenerator writer, JsonNo
}

writer.writeEndObject();

writer.flush();
writer.close();
}
}

0 comments on commit 9786981

Please sign in to comment.