Skip to content

Commit 5a27a73

Browse files
Merge pull request #2 from relogiclabs/develop
Add New Features
2 parents c51662f + e7634e4 commit 5a27a73

File tree

99 files changed

+5700
-836
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5700
-836
lines changed

.github/workflows/static.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

JsonSchema.Tests/JsonSchema.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<IsPackable>false</IsPackable>
88
<AssemblyName>RelogicLabs.JsonSchema.Tests</AssemblyName>
99
<Company>Relogic Labs</Company>
10-
<RootNamespace/>
10+
<RootNamespace />
1111
</PropertyGroup>
1212

1313
<ItemGroup>

JsonSchema.Tests/RelogicLabs/JsonSchema/Tests/Negative/ArrayTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,28 @@ public void When_InvalidJsonInArray_ExceptionThrown()
165165
Assert.AreEqual(JPRS01, exception.ErrorCode);
166166
Console.WriteLine(exception);
167167
}
168+
169+
[TestMethod]
170+
public void When_EmptyArrayInObject_ExceptionThrown()
171+
{
172+
var schema =
173+
"""
174+
{
175+
"key1": @nonempty #array,
176+
"key2": @nonempty
177+
}
178+
""";
179+
var json =
180+
"""
181+
{
182+
"key1": [],
183+
"key2": []
184+
}
185+
""";
186+
JsonSchema.IsValid(schema, json);
187+
var exception = Assert.ThrowsException<JsonSchemaException>(
188+
() => JsonAssert.IsValid(schema, json));
189+
Assert.AreEqual(NEMT02, exception.ErrorCode);
190+
Console.WriteLine(exception);
191+
}
168192
}

0 commit comments

Comments
 (0)