@@ -428,43 +428,44 @@ static XplBool SchemaValidate(WJElement schema, WJElement document,
428
428
/* swap in any $ref'erenced schema */
429
429
if (str = WJEString (schema , "[\"$ref\"]" , WJE_GET , NULL )) {
430
430
431
- // Johan: Add Inline dereferencing. Looking for definitions
432
- const char * inline_dereferencing = "#/definitions/" ;
433
- if (strncmp (inline_dereferencing , str , strlen (inline_dereferencing )) == 0 ) {
434
- WJElement schema_root = schema -> parent ;
435
- while (schema_root -> parent ) {
436
- schema_root = schema_root -> parent ;
437
- }
438
-
439
- WJElement schema_definitions = WJEObject (schema_root , "definitions" , WJE_GET );
440
- if (schema_definitions ) {
441
- char * ptr = strrchr (str , '/' );
442
- if (ptr ) {
443
- ++ ptr ;
444
- sub = WJEObject (schema_definitions , ptr , WJE_GET );
445
- if (sub ) {
446
- fail = SchemaValidate (sub , document , err , loadcb , freecb , client ,
447
- name ,
448
- version );
449
- return fail ;
450
- }
451
- }
452
- }
453
- }
454
-
455
- if (loadcb ) {
456
- sub = loadcb (str , client , __FILE__ , __LINE__ );
457
-
458
- fail = SchemaValidate (sub , document , err , loadcb , freecb , client ,
459
- name ,
460
- version );
461
- if (freecb ) {
462
- freecb (sub , client );
463
- }
464
- else {
465
- WJECloseDocument (sub );
466
- }
467
- }
431
+ // Johan: Add Inline dereferencing. Looking for definitions
432
+ const char * inline_dereferencing = "#/definitions/" ;
433
+ if (strncmp (inline_dereferencing , str ,
434
+ strlen (inline_dereferencing )) == 0 ) {
435
+ WJElement schema_root = schema -> parent ;
436
+ while (schema_root -> parent ) {
437
+ schema_root = schema_root -> parent ;
438
+ }
439
+
440
+ WJElement schema_definitions = WJEObject (schema_root ,
441
+ "definitions" ,
442
+ WJE_GET );
443
+ if (schema_definitions ) {
444
+ char * ptr = strrchr (str , '/' );
445
+ if (ptr ) {
446
+ ++ ptr ;
447
+ sub = WJEObject (schema_definitions , ptr , WJE_GET );
448
+ if (sub ) {
449
+ fail = SchemaValidate (sub , document , err ,
450
+ loadcb , freecb ,
451
+ client , name , version );
452
+ return fail ;
453
+ }
454
+ }
455
+ }
456
+ }
457
+
458
+ if (loadcb ) {
459
+ sub = loadcb (str , client , __FILE__ , __LINE__ );
460
+ fail = SchemaValidate (sub , document , err , loadcb , freecb ,
461
+ client , name , version );
462
+ if (freecb ) {
463
+ freecb (sub , client );
464
+ }
465
+ else {
466
+ WJECloseDocument (sub );
467
+ }
468
+ }
468
469
return fail ;
469
470
}
470
471
0 commit comments