public void configure()

in src/main/java/software/amazon/event/kafkaconnector/mapping/JsonPathDetailTypeMapper.java [111:131]


  public void configure(EventBridgeSinkConfig config) {
    if (config == null) {
      throw new IllegalArgumentException("EventBridgeSinkConfig cannot be null.");
    }

    var jsonPath = config.getString(AWS_DETAIL_TYPES_MAPPER_JSON_PATH_MAPPER_FIELDREF);

    if (jsonPath == null || jsonPath.trim().isEmpty()) {
      throw new IllegalArgumentException(
          "JSON path configuration must be provided and cannot be empty.");
    }

    var path = JsonPath.compile(jsonPath);
    if (!path.isDefinite()) {
      throw new IllegalArgumentException(
          format("JSON path must be definite but '%s' is not", jsonPath));
    }

    this.jsonPath = path.getPath();
    log.info("JsonPathDetailTypeMapper configured successfully with JSON path '{}'", this.jsonPath);
  }