Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/complete/http/test-response-types.http
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Send POST request with json body
POST {{endpoint}}/{{name}}?annotations=:Token
POST {{endpoint}}/{{name}}?annotations=:Token&annotations=:Sentence
Content-Type: text/plain
Accept: application/json

Expand All @@ -10,11 +10,12 @@ client.test("Request executed successfully", function() {
client.assert(response.contentType.mimeType === "application/json", "Content-Type is not application/json");
client.assert(response.body.text === "Hello World!");
client.assert(response.body.entities.Token.length === 3, "We have 3 tokens!");
client.assert(response.body.entities.Sentence.length === 1, "We have 1 sentence!");
});
%}

### Send POST request for gate+xml
POST {{endpoint}}/{{name}}?annotations=:Token
POST {{endpoint}}/{{name}}?annotations=:Token&annotations=:Sentence
Content-Type: text/plain
Accept: application/gate+xml

Expand All @@ -30,7 +31,7 @@ client.test("Request executed successfully", function() {
%}

###
POST {{endpoint}}/{{name}}?annotations=:Token
POST {{endpoint}}/{{name}}?annotations=:Token&annotations=:Sentence
Content-Type: text/plain
Accept: application/gate+xml; includeText=no

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/zeroae/gate/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private APIGatewayProxyResponseEvent export(

// Include the selected annotations in the doc features.
if (annotationSelector != null)
doc.getFeatures().put("gate.cloud.annotationSelectors", annotationSelector);
doc.getFeatures().put("gate.cloud.annotationSelectors", String.join(",", annotationSelector));

// Take *all* annotation types and filter based on AnnotationSelector
final AnnotationSet defaultAnnots = doc.getAnnotations();
Expand Down