String maybeReshapeData()

in invoker/core/src/main/java/com/google/cloud/functions/invoker/GcfEvents.java [229:241]


    String maybeReshapeData(Event legacyEvent, String jsonData) {
      // The reshaping code is disabled for now, because the specification for how the legacy
      // "params"
      // field should be represented in a CloudEvent is in flux.
      if (true || legacyEvent.getContext().params().isEmpty()) {
        return jsonData;
      }
      JsonObject jsonObject = GSON.fromJson(jsonData, JsonObject.class);
      JsonObject wildcards = new JsonObject();
      legacyEvent.getContext().params().forEach((k, v) -> wildcards.addProperty(k, v));
      jsonObject.add("wildcards", wildcards);
      return GSON.toJson(jsonObject);
    }