Skip to content

Commit 44a14f7

Browse files
millotpFluf22
authored andcommitted
reset the context
1 parent 813e3e0 commit 44a14f7

File tree

1 file changed

+7
-0
lines changed
  • generators/src/main/java/com/algolia/codegen/cts/tests

1 file changed

+7
-0
lines changed

generators/src/main/java/com/algolia/codegen/cts/tests/Snippet.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ public String toString() {
3838
}
3939

4040
public void addMethodCall(Map<String, Object> context, ParametersWithDataType paramsType, CodegenOperation ope) throws CTSException {
41+
// for dynamic snippets, we need to reset the context because the order if generation is random
4142
context.put("method", method);
43+
context.put("returnType", null);
44+
context.put("requestOptions", null);
45+
context.put("parameters", null);
46+
context.put("parametersWithDataType", null);
47+
context.put("parametersWithDataTypeMap", null);
48+
4249
if (ope.returnType != null && ope.returnType.length() > 0) {
4350
context.put("returnType", camelize(ope.returnType));
4451
}

0 commit comments

Comments
 (0)