Signed-off-by: Johnny Lim <izeye@naver.com>

See gh-44034
This commit is contained in:
Johnny Lim
2025-01-31 21:04:18 +09:00
committed by Stéphane Nicoll
parent a33b700b12
commit a39e1c4a09
10 changed files with 23 additions and 32 deletions

View File

@@ -33,12 +33,12 @@ public final class ItemIgnore implements Comparable<ItemIgnore> {
private final String name;
private ItemIgnore(ItemType type, String name) {
if (name == null) {
throw new IllegalArgumentException("'name' must not be null");
}
if (type == null) {
throw new IllegalArgumentException("'type' must not be null");
}
if (name == null) {
throw new IllegalArgumentException("'name' must not be null");
}
this.type = type;
this.name = name;
}

View File

@@ -92,8 +92,9 @@ public class JsonMarshaller {
}
JSONObject ignored = object.optJSONObject("ignored");
if (ignored != null) {
checkAllowedKeys(ignored, path.resolve("ignored"), "properties");
addIgnoredProperties(metadata, ignored, path.resolve("ignored"));
JsonPath ignoredPath = path.resolve("ignored");
checkAllowedKeys(ignored, ignoredPath, "properties");
addIgnoredProperties(metadata, ignored, ignoredPath);
}
return metadata;
}

View File

@@ -348,7 +348,7 @@ class JsonMarshallerTests {
}
@Test
void shouldCheckIgnoreFields() {
void shouldCheckIgnoredFields() {
String json = """
{
"ignored": {
@@ -362,7 +362,7 @@ class JsonMarshallerTests {
}
@Test
void shouldCheckIgnorePropertiesFields() {
void shouldCheckIgnoredPropertiesFields() {
String json = """
{
"ignored": {