code: private void validateMedia(JsonNode data) throws InvalidInputException {
      for (JsonNode node : data.findParents(INDEX)) {
        JsonNode text = node.path(TEXT);
        if (!text.isMissingNode() && (!text.isArray() || !text.get(0).isArray())) {
          throw new InvalidInputException(String.format("Invalid table payload: %s (index: %s)", text.asText(), node.get(INDEX)));
        }
      }
    }
docs: Verify that JSON media node contains valid table payload.