Package org.apache.juneau.console
Class PageContractSchema
java.lang.Object
org.apache.juneau.console.PageContractSchema
Loads
juneau-page.schema.json from the classpath and validates contracts against it, plus
the cross-reference rules R-1..R-4 the schema cannot express. Used by PageCapture in dev
mode and by PageContractAssert in tests.
Example:
List<String>
- Since:
- 10.0.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PageContractSchemaget()Returns the shared instance.Returns the schema text exactly as shipped.Validates a contract against the schema and rules R-1..R-3.Validates a contract against the schema and rules R-1..R-4.
-
Field Details
-
RESOURCE
Classpath location of the schema.- See Also:
-
-
Method Details
-
get
Returns the shared instance.- Returns:
- The shared instance, never
null .
-
schemaJson
Returns the schema text exactly as shipped.- Returns:
- The schema JSON.
-
validate
Validates a contract against the schema and rules R-1..R-3.- Parameters:
contractJson- The contract JSON.- Returns:
- The findings, empty when valid.
-
validate
Validates a contract against the schema and rules R-1..R-4.- Parameters:
contractJson- The contract JSON.templateIds- The<template data-card|data-slot>ids present in the page, ornull to skip R-4.- Returns:
- The findings, empty when valid.
-