Skip to content

Commit 64a07f2

Browse files
committed
Add test for properties
1 parent eba68e6 commit 64a07f2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/commonTest/kotlin/io/github/optimumcode/json/schema/base/JsonSchemaTest.kt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,42 @@ class JsonSchemaTest : FunSpec() {
156156
}
157157
}
158158

159+
test("does not report circled references if have one of the applicators that might not be invoked") {
160+
shouldNotThrowAny {
161+
JsonSchema.fromDefinition(
162+
"""
163+
{
164+
"${KEY}schema": "http://json-schema.org/draft-07/schema#",
165+
"definitions": {
166+
"alice": {
167+
"allOf": [
168+
{ "${KEY}ref": "#/definitions/bob" }
169+
]
170+
},
171+
"bob": {
172+
"properties": {
173+
"test": {
174+
"allOf": [
175+
{ "${KEY}ref": "#/definitions/alice" }
176+
]
177+
}
178+
}
179+
}
180+
},
181+
"properties": {
182+
"alice": {
183+
"${KEY}ref": "#/definitions/alice"
184+
},
185+
"bob": {
186+
"${KEY}ref": "#/definitions/bob"
187+
}
188+
}
189+
}
190+
""".trimIndent(),
191+
)
192+
}
193+
}
194+
159195
listOf(
160196
"document root" to
161197
listOf(

0 commit comments

Comments
 (0)