ZupIT/nimbus

SendRequest Post with data

Closed this issue · 1 comments

SendRequest action does not work for Post with data. onSuccess and onError events are not triggered.

Sample:

{
  "_:component": "layout:screen",
  "state": {
    "body": {
      "value1": "value1",
      "value2": 2,
      "value3": true
    }
  },
  "children": [
    {
      "_:component": "store:button",
      "properties": {
        "onPress": [
          {
            "_:action": "sendRequest",
            "properties": {
              "onError": [
                {
                  "_:action": "log",
                  "properties": {
                    "message": "error",
                    "level": "Error"
                  }
                }
              ],
              "onSuccess": [
                {
                  "_:action": "log",
                  "properties": {
                    "message": "success",
                    "level": "Error"
                  }
                }
              ],
              "data": "@{body}",
              "method": "Post",
              "url": "http://localhost:3000/order"
            }
          }
        ],
        "text": "Request"
      }
    }
  ]
}

Log message:

[31mError while executing action "sendRequest".
  Serializer for class 'Any' is not found.
  Mark the class as @Serializable or provide the serializer explicitly.
  On Kotlin/Native explicitly declared serializer should be used for interfaces and enums without @Serializable annotation[0m