Skip to content

Commit

Permalink
MAINT: backfill documentation into json property for substitute_string (
Browse files Browse the repository at this point in the history
opensearch-project#4727)

* MAINT: backfill documentation into json property for substitute_string

Signed-off-by: George Chen <[email protected]>
  • Loading branch information
chenqi0805 authored Jul 12, 2024
1 parent 62682da commit 59a4df4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@
package org.opensearch.dataprepper.plugins.processor.mutatestring;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import org.opensearch.dataprepper.model.event.EventKey;

import java.util.List;

public class SubstituteStringProcessorConfig implements StringProcessorConfig<SubstituteStringProcessorConfig.Entry> {
public static class Entry {
@JsonPropertyDescription("The key to modify.")
private EventKey source;
@JsonPropertyDescription("The Regex String to be replaced. Special regex characters such as `[` and `]` must " +
"be escaped using `\\\\` when using double quotes and `\\ ` when using single quotes. " +
"See [Java Patterns](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html) " +
"for more information.")
private String from;
@JsonPropertyDescription("The String to be substituted for each match of `from`.")
private String to;

@JsonProperty("substitute_when")
Expand Down Expand Up @@ -43,6 +50,7 @@ public Entry(final EventKey source, final String from, final String to, final St
public Entry() {}
}

@JsonPropertyDescription("List of entries. Valid values are `source`, `from`, and `to`.")
private List<Entry> entries;

public List<Entry> getEntries() {
Expand Down

0 comments on commit 59a4df4

Please sign in to comment.