Skip to content

Commit eca9801

Browse files
committed
Merge pull request #16 from RusticiSoftware/category-json-marshalling
Fix bug in JSON marshalling for the category context activity.
2 parents 1dfe13a + d39e7d7 commit eca9801

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/rusticisoftware/tincan/ContextActivities.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,15 @@ public ObjectNode toJSONNode(TCAPIVersion version) {
160160
}
161161
}
162162
if (this.category != null && this.category.size() > 0) {
163-
if (version.ordinal() <= TCAPIVersion.V100.ordinal()) {
163+
if (version.ordinal() >= TCAPIVersion.V100.ordinal()) {
164164
ArrayNode category = mapper.createArrayNode();
165165
node.put("category", category);
166166

167167
for (Activity element : this.getCategory()) {
168168
category.add(element.toJSONNode(version));
169169
}
170+
} else {
171+
throw new IncompatibleTCAPIVersion("Version " + version.toString() + " doesn't support the category context activity");
170172
}
171173
}
172174

0 commit comments

Comments
 (0)