Skip to content

Commit fd6e18d

Browse files
committed
Update README with evaluation plugin changes
1 parent dc17baa commit fd6e18d

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

README.md

+14-20
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ The following types are used in the above definitions
248248
249249
* **OutputFormat**: **FLAG**
250250
251-
Only the `FLAG` output format is part of the Stable API. Additional output
252-
formats are included as part of the Experimental API.
251+
Only the `FLAG` output format is part of the Stable API. Additional [output
252+
formats](#output-formats) are included as part of the Experimental API.
253253
* **OutputUnit**: { valid: boolean }
254254
255255
Output is an experimental feature of the JSON Schema specification. There
@@ -336,7 +336,8 @@ These are available from the `@hyperjump/json-schema/bundle` export.
336336
The `FLAG` output format isn't very informative. You can change the output
337337
format used for validation to get more information about failures. The official
338338
output format is still evolving, so these may change or be replaced in the
339-
future.
339+
future. This implementation currently supports the BASIC and DETAILED output
340+
formats.
340341
341342
```javascript
342343
import { BASIC } from "@hyperjump/json-schema/experimental";
@@ -536,28 +537,21 @@ These are available from the `@hyperjump/json-schema/experimental` export.
536537
validation of its own. In these cases, it isn't helpful to include
537538
them in BASIC output. This flag is used to trim those nodes from the
538539
output.
539-
* collectEvaluatedProperties?: (compiledKeywordValue: any, instance: JsonNode, context: ValidationContext, isTop?: boolean) => Set\<string> | false
540-
541-
If the keyword is an applicator, it will need to implement this
542-
function for `unevaluatedProperties` to work as expected.
543-
* collectEvaluatedItems?: (compiledKeywordValue: A, instance: JsonNode, context: ValidationContext, isTop?: boolean) => Set\<number> | false
544-
545-
If the keyword is an applicator, it will need to implement this
546-
function for `unevaluatedItems` to work as expected.
547-
* collectExternalIds?: (visited: Set\<string>, parentSchema: Browser, schema: Browser) => Set\<string>
548-
If the keyword is an applicator, it will need to implement this
549-
function to work properly with the [bundle](#bundling) feature.
550-
* annotation?: (compiledKeywordValue: any) => any
540+
* annotation?: (compiledKeywordValue: any) => any | undefined
551541
552542
If the keyword is an annotation, it will need to implement this
553543
function to return the annotation.
544+
* plugin?: EvaluationPlugin
554545
555546
* **ValidationContext**: object
556547
* ast: AST
557-
* dynamicAnchors: object
558-
* schemaUrl: string
559-
* errors: OutputUnit[]
560-
* annotations: OutputUnit[]
548+
* plugins: EvaluationPlugins[]
549+
550+
* **EvaluationPlugin**: object
551+
* beforeSchema(url: string, instance: JsonNode, context: Context): void
552+
* beforeKeyword(keywordNode: Node<any>, instance: JsonNode, context: Context, schemaContext: Context, keyword: Keyword): void
553+
* afterKeyword(keywordNode: Node<any>, instance: JsonNode, context: Context, valid: boolean, schemaContext: Context, keyword: Keyword): void
554+
* afterSchema(url: string, instance: JsonNode, context: Context, valid: boolean): void
561555
* **defineVocabulary**: (id: string, keywords: { [keyword: string]: string }) => void
562556
563557
Define a vocabulary that maps keyword name to keyword URIs defined using
@@ -596,7 +590,7 @@ These are available from the `@hyperjump/json-schema/experimental` export.
596590
* **getSchema**: (uri: string, browser?: Browser) => Promise\<Browser>
597591
598592
Get a schema by it's URI taking the local schema registry into account.
599-
* buildSchemaDocument: (schema: SchemaObject | boolean, retrievalUri?: string, contextDialectId?: string) => SchemaDocument
593+
* **buildSchemaDocument**: (schema: SchemaObject | boolean, retrievalUri?: string, contextDialectId?: string) => SchemaDocument
600594
601595
Build a SchemaDocument from a JSON-compatible value. You might use this if
602596
you're creating a custom media type plugin, such as supporting JSON Schemas

0 commit comments

Comments
 (0)