You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/12/06 03:02:31 UTC

[GitHub] [shenyu] yu199195 commented on a diff in pull request #4236: [ISSUE #4235]supports generation of mock data on request

yu199195 commented on code in PR #4236:
URL: https://github.com/apache/shenyu/pull/4236#discussion_r1040385687


##########
shenyu-plugin/shenyu-plugin-mock/src/main/java/org/apache/shenyu/plugin/mock/generator/ExpressionGenerator.java:
##########
@@ -49,8 +47,10 @@ public String getName() {
     public String doGenerate(final List<String> params, final String rule, final MockRequest mockRequest) {
 
         String expression = params.get(0);
-        CONTEXT.setVariable("req", mockRequest);
-        Object val = PARSER.parseExpression(expression).getValue(CONTEXT);
+        EvaluationContext context = initContext();

Review Comment:
   here,no thread safety .



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org