dreamhead / moco

Easy Setup Stub Server
MIT License
4.36k stars 1.08k forks source link

Template for Event Action unsupported? #200

Closed superc254 closed 7 years ago

superc254 commented 7 years ago

i copy this code in my config:

{
  "request": {
    "uri": "/event"
  },
  "response": {
    "text": "event"
  },
  "on": {
    "complete": {
      "post": {
        "url": "http://localhost:12306/target",
        "content": {
          "template": {
            "with": "${target}",
            "vars": {
              "target" : "target"
            }
          }
        }
      }
    }
  }
}

and i got this message:

14 六月 2017 21:26:54 [main] INFO  Can not deserialize instance of java.lang.String out of START_OBJECT token
 at [Source: java.io.FileInputStream@6e262d42; line: 13, column: 17] (through reference chain: java.util.ArrayList[0]->com.github.dreamhead.moco.parser.model.SessionSetting["on"]->com.github.dreamhead.moco.parser.model.EventSetting["complete"]->com.github.dreamhead.moco.parser.model.CompleteEventSetting["post"]->com.github.dreamhead.moco.parser.model.PostSetting["content"]) java.util.ArrayList[0]->com.github.dreamhead.moco.parser.model.SessionSetting["on"]->com.github.dreamhead.moco.parser.model.EventSetting["complete"]->com.github.dreamhead.moco.parser.model.CompleteEventSetting["post"]->com.github.dreamhead.moco.parser.model.PostSetting["content"]
14 六月 2017 21:26:54 [main] ERROR com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token
 at [Source: java.io.FileInputStream@6e262d42; line: 13, column: 17] (through reference chain: java.util.ArrayList[0]->com.github.dreamhead.moco.parser.model.SessionSetting["on"]->com.github.dreamhead.moco.parser.model.EventSetting["complete"]->com.github.dreamhead.moco.parser.model.CompleteEventSetting["post"]->com.github.dreamhead.moco.parser.model.PostSetting["content"])
superc254 commented 7 years ago

the latest version has support this