XContent and Aggregations replacing agg names

Hi there, kinda an obscure issue here.

So basically I'm extracting the aggs from the search result like this:

val json = XContentFactory.jsonBuilder().use { json ->
                    json.startObject()
                    aggregations.toXContent(json, ToXContent.EMPTY_PARAMS)
                    json.endObject()
                }.string()

And somehow the names of the aggregations are being replaced with like a hash tag thing. I didn't submit the agg name as filter#facet or lterms#foo

result : {
  "filter#facet" : {
    "doc_count" : 2,
    "lterms#foo" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [ {
        "key" : 1800475,
        "doc_count" : 1
      }, {
        "key" : 3153775,
        "doc_count" : 1
      } ]
    }
  }
}

Any help would be greatly appreciated!

This is on 6.2.4 BTW.

This has something to do with typed keys, just not sure how to disable it.