@@ -7,6 +7,7 @@ import scala.reflect.ClassTag
7
7
8
8
import org .json4s .JsonDSL ._
9
9
import org .json4s ._
10
+ import org .json4s .jackson .JsonMethods ._
10
11
11
12
import Helpers ._
12
13
import utils .JsonPointer
@@ -421,7 +422,13 @@ final case class ProductSchemaTypesProperty(
421
422
Seq .empty
422
423
} else {
423
424
val maxLevel = maxAnomalyLevels.flatten.max
424
- Seq (Anomaly (path, f " failed match for ${value} in schema " , maxLevel))
425
+ Seq (
426
+ Anomaly (
427
+ path,
428
+ f " failed match for ${compact(render(value))} in schema " ,
429
+ maxLevel
430
+ )
431
+ )
425
432
}
426
433
427
434
// At least one schema must have no anomalies or only info level
@@ -434,7 +441,13 @@ final case class ProductSchemaTypesProperty(
434
441
Seq .empty
435
442
} else {
436
443
val maxLevel = maxAnomalyLevels.flatten.max
437
- Seq (Anomaly (path, f " failed match for ${value} in schema " , maxLevel))
444
+ Seq (
445
+ Anomaly (
446
+ path,
447
+ f " failed match for ${compact(render(value))} in schema " ,
448
+ maxLevel
449
+ )
450
+ )
438
451
}
439
452
440
453
// Info anomalies are fine in multiple schemas
@@ -447,12 +460,18 @@ final case class ProductSchemaTypesProperty(
447
460
// We take the lowest anomaly level from each schema
448
461
// since this is the schema with the closest match
449
462
val minAnomalyLevel = maxAnomalyLevels.flatten.min
450
- Seq (Anomaly (path, f " no matches found for ${value}" , minAnomalyLevel))
463
+ Seq (
464
+ Anomaly (
465
+ path,
466
+ f " no matches found for ${compact(render(value))}" ,
467
+ minAnomalyLevel
468
+ )
469
+ )
451
470
} else {
452
471
Seq (
453
472
Anomaly (
454
473
path,
455
- f " multiple matches found for ${value}" ,
474
+ f " multiple matches found for ${compact(render( value)) }" ,
456
475
AnomalyLevel .Fatal
457
476
)
458
477
)
0 commit comments