Skip to content

Commit 5acac64

Browse files
committed
No need of callback method to load schemas if inline definitons is used.
1 parent 8f74bf5 commit 5acac64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wjelement/schema.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static XplBool SchemaValidate(WJElement schema, WJElement document,
426426
}
427427

428428
/* swap in any $ref'erenced schema */
429-
if(loadcb && (str = WJEString(schema, "[\"$ref\"]", WJE_GET, NULL))) {
429+
if(str = WJEString(schema, "[\"$ref\"]", WJE_GET, NULL)) {
430430

431431
// Johan: Add Inline dereferencing. Looking for definitions
432432
const char* inline_dereferencing = "#/definitions/";
@@ -446,12 +446,13 @@ static XplBool SchemaValidate(WJElement schema, WJElement document,
446446
fail = SchemaValidate (sub, document, err, loadcb, freecb, client,
447447
name,
448448
version);
449+
return fail;
449450
}
450451
}
451452
}
452453
}
453454

454-
if (!sub) {
455+
if (loadcb) {
455456
sub = loadcb (str, client, __FILE__, __LINE__);
456457

457458
fail = SchemaValidate (sub, document, err, loadcb, freecb, client,

0 commit comments

Comments
 (0)