Skip to content

Commit

Permalink
Revert getBodyAsString changes (unrelated and we need to update mock)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Oct 12, 2023
1 parent 598ff75 commit b99998b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public Handler<RoutingContext> createPost(String serviceName) {
JsonObject jsonBody;
MIMEHeader contentType = routingContext.parsedHeaders().contentType();
if (contentType != null && contentType.value() != null && contentType.value().equals("application/json")) {
String bodyAsString = routingContext.body().asString();
String bodyAsString = routingContext.getBodyAsString();
if (bodyAsString == null || bodyAsString.trim().isEmpty()) {
routingContext.fail(new BadRequestException("Request body must not be empty."));
return;
Expand All @@ -98,7 +98,7 @@ public Handler<RoutingContext> createPost(String serviceName) {
} else {
// assumes that the Content-Type is "plain/text" (default)
jsonBody = new JsonObject();
diagramSource = routingContext.body().asString();
diagramSource = routingContext.getBodyAsString();
if (diagramSource == null || diagramSource.trim().isEmpty()) {
routingContext.fail(new BadRequestException("Request body must not be empty."));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public DiagramRest(DiagramRegistry registry) {

public Handler<RoutingContext> create() {
return routingContext -> {
String bodyAsString = routingContext.body().asString();
String bodyAsString = routingContext.getBodyAsString();
if (bodyAsString == null || bodyAsString.trim().isEmpty()) {
routingContext.fail(new BadRequestException("Request body must not be empty."));
return;
Expand Down

0 comments on commit b99998b

Please sign in to comment.