Skip to content

Commit

Permalink
MAINT: backfill documentation in JsonPropertyDescription for split_st…
Browse files Browse the repository at this point in the history
…ring (#4720)

* MAINT: add documentation in JsonPropertyDescription for split_string processor

Signed-off-by: George Chen <[email protected]>
  • Loading branch information
chenqi0805 authored Jul 13, 2024
1 parent a988177 commit 37b664b
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
Expand All @@ -20,15 +21,23 @@ public static class Entry {

@NotEmpty
@NotNull
@JsonPropertyDescription("The key to split.")
private EventKey source;

@JsonProperty("delimiter_regex")
@JsonPropertyDescription("The regex string responsible for the split. Cannot be defined at the same time as `delimiter`. " +
"At least `delimiter` or `delimiter_regex` must be defined.")
private String delimiterRegex;

@Size(min = 1, max = 1)
@JsonPropertyDescription("The separator character responsible for the split. " +
"Cannot be defined at the same time as `delimiter_regex`. " +
"At least `delimiter` or `delimiter_regex` must be defined.")
private String delimiter;

@JsonProperty("split_when")
@JsonPropertyDescription("Specifies under what condition the `split_string` processor should perform splitting. " +
"Default is no condition.")
private String splitWhen;

public EventKey getSource() {
Expand Down Expand Up @@ -61,6 +70,7 @@ public List<Entry> getIterativeConfig() {
return entries;
}

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

public List<Entry> getEntries() {
Expand Down

0 comments on commit 37b664b

Please sign in to comment.