Skip to content

Commit 7ef992c

Browse files
authored
Merge pull request #49 from zeroae/i/fix-serialization-issue
Fix serialization of annotationSelectors in the exported GateXML docu…
2 parents 4150079 + 179b146 commit 7ef992c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/complete/http/test-response-types.http

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### Send POST request with json body
2-
POST {{endpoint}}/{{name}}?annotations=:Token
2+
POST {{endpoint}}/{{name}}?annotations=:Token&annotations=:Sentence
33
Content-Type: text/plain
44
Accept: application/json
55

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

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

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

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

src/main/java/co/zeroae/gate/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private APIGatewayProxyResponseEvent export(
232232

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

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

0 commit comments

Comments
 (0)