artillery

How can I escape "." characters in Artillery to prevent nesting?


I have an artillery file where one of my requests is defined as so:

{
  "post": {
    "url": "/apps/stash/foo/search",
    "json": {
      "size": 100,
      "from": 0,
      "query": {
        "bool": {
          "must": {
            "nested": {
              "path": "text_analytics.entities.person",
              "query": {
                "bool": {
                  "must": {
                    "match": {
                      "text_analytics.entities.person.text": "Boris Johnson"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

However, when I run this request, the json that gets sent out is this:

{
  "json": {
    "size": 100,
    "from": 0,
    "query": {
      "bool": {
        "must": {
          "nested": {
            "path": "text_analytics.entities.person",
            "query": {
              "bool": {
                "must": {
                  "match": {
                    "text_analytics.entities.person.text": "Boris Johnson",
                    "text_analytics": {
                      "entities": {
                        "person": {
                          "text": "Boris Johnson"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

As you can see, it has added a key to the match object called text_analytics where it has automatically nested objects by splitting on the . character.

How can I stop artillery doing this?


Solution

  • Looks like it's actually a bug in artillery.

    https://github.com/artilleryio/artillery/issues/723