Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Slf4j
public abstract class InterpolatedDeserializer<T> extends JsonDeserializer<T> {

private static final Pattern PATTERN = Pattern.compile("(?<placeholder>\\$\\{(?<varName>[\\w.]+)(:-(?<defaultValue>[\\w~\\s-.:/\\\\]*))?})");
private static final Pattern PATTERN = Pattern.compile("(?<placeholder>\\$\\{(?<varName>[\\w.]+)(:-(?<defaultValue>[\\w~\\s-.:/\\\\=]*))?})");

private final Vars vars = Vars.getInstance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class InterpolatedObjectDeserializer extends JsonDeserializer<Object> {

private static final InterpolatedObjectDeserializer INSTANCE = new InterpolatedObjectDeserializer();
private static final Pattern INT_PATTERN = Pattern.compile("(?<placeholder>\\$<(?<varName>[\\w.]+)(:-(?<defaultValue>[\\w~.:/\\\\]*))?>)");
private static final Pattern INT_PATTERN = Pattern.compile("(?<placeholder>\\$<(?<varName>[\\w.]+)(:-(?<defaultValue>[\\w~\\s-.:/\\\\=]*))?>)");
private static final Pattern NUMBER = Pattern.compile("-?\\d+(.\\d+|,\\d+)?");

private final Vars vars = Vars.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static Stream<Arguments> valuesProvider() {
arguments("$<notSet:->", 0),
arguments("$<not.set>", 0),
arguments("$<notSet>", 0),
arguments("$<notSet:-stringDefault>", 0),
arguments("$<notSet:-~123stringDefault=va:lue.\\/>", 0),
arguments("$<varInEnv:-123>", Integer.parseInt(VAR_IN_ENV)),
arguments("$<varInEnv>", Integer.parseInt(VAR_IN_ENV))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ static Stream<Arguments> valuesProvider() {
arguments("${notSet:-${varInEnv:-local}}-nested", VAR_IN_ENV + "-nested"),
arguments("${notSet:-${varInEnv:-local}}-nested-${varInEnv}", VAR_IN_ENV + "-nested-" + VAR_IN_ENV),
arguments("${notSet:-local.dots}", "local.dots"),
arguments("${notSet:---key=value}", "--key=value"),
arguments("${notSet:-}", ""),
arguments("${varInEnv:-local}", VAR_IN_ENV),
arguments("${varInEnv}", VAR_IN_ENV),
Expand Down
Loading