Skip to content

Commit 850a78e

Browse files
committed
update schema docs
1 parent 40192f4 commit 850a78e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

_docs/schema/basics.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ There are two options when building a schema: defining it inline using the fluen
4747

4848
## Serialization and Deserialization {#schema-deserialization}
4949

50-
*JsonSchema.Net* schemas are fully serializable.
50+
_JsonSchema.Net_ schemas are fully serializable.
5151

5252
```c#
5353
var mySchema = JsonSchema.FromText(content);
@@ -463,7 +463,8 @@ New formats must be registered via the `Formats.Register()` static method. This
463463

464464
The `EvaluationOptions` class gives you a few configuration points for customizing how the evaluation process behaves. It is an instance class and can be passed into the `JsonSchema.Evaluate()` method. If no options are explicitly passed, a copy of `JsonSchemaOptions.Default` will be used.
465465

466-
- `EvaluateAs` - Indicates which schema version to process as. This will filter the keywords of a schema based on their support. This means that if any keyword is not supported by this version, it will be ignored.
466+
- `EvaluateAs` - Indicates which schema version to process as. This will filter the keywords of a schema based on their support. This means that if any keyword is not supported by this version, it will be ignored. This will need to be set when you create the options.
467+
- `SchemaRegistry` - Provides a way to register schemas only for the evaluations that use this set of options.
467468
- `EvaluateMetaSchema` - Indicates whether the schema should be evaluated against its `$schema` value (its meta-schema). This is not typically necessary. Note that the evaluation process will still attempt to resolve the meta-schema. \*
468469
- `OutputFormat` - You already read about output formats above. This is the property that controls it all. By default, a single "flag" node is returned. This also yields the fastest evaluation times as it enables certain optimizations.
469470
- `RequireFormatValidation` - Forces `format` validation.
@@ -549,7 +550,7 @@ var randomString = JsonSchema.FromFile("random-string.json");
549550
SchemaRegistry.Global.Register(new Uri("http://localhost/random-string"), randomString);
550551
```
551552

552-
Now *JsonSchema.Net* will be able to resolve the reference.
553+
Now _JsonSchema.Net_ will be able to resolve the reference.
553554

554555
> `JsonSchema.FromFile()` automatically sets the schema's base URI to the file path. If you intend to use file paths in your references (e.g. `file:///C:\random-string.json`), then just register the schema without passing a URI:
555556
>
@@ -576,7 +577,7 @@ var referenceableJson = new JsonNodeBaseDocument(json, "http://localhost/jsondat
576577
SchemaRegistry.Global.Register(referenceableJson);
577578
578579
var schema = new JsonSchemaBuilder()
579-
.Ref("http://localhost/jsondata#/schema)
580+
.Ref("http://localhost/jsondata#/schema")
580581
.Build();
581582
```
582583

_docs/schema/vocabs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ The `maximum` keyword is basically all instance. It asks, "Is the instance a nu
158158

159159
```c#
160160
public KeywordConstraint GetConstraint(SchemaConstraint schemaConstraint,
161-
IReadOnlyList<KeywordConstraint> localConstraints,
161+
ReadOnlySpan<KeywordConstraint> localConstraints,
162162
EvaluationContext context)
163163
{
164164
return new KeywordConstraint(Name, Evaluator);
@@ -218,7 +218,7 @@ More specifically to our task here, `properties` gives us a list of subschemas t
218218

219219
```c#
220220
public KeywordConstraint GetConstraint(SchemaConstraint schemaConstraint,
221-
IReadOnlyList<KeywordConstraint> localConstraints,
221+
ReadOnlySpan<KeywordConstraint> localConstraints,
222222
EvaluationContext context)
223223
{
224224
var subschemaConstraints = Properties

0 commit comments

Comments
 (0)