Skip to content

Commit 837f5cf

Browse files
author
json-everything-ci
committed
regenerated api docs
1 parent cf4fca5 commit 837f5cf

11 files changed

+99
-86
lines changed

_docs/api/JsonSchema.Net.Generation.DataAnnotations/AllowedValuesAttributeHandler.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,16 @@ order: "10.06.000"
1717
- IAttributeHandler\<AllowedValuesAttribute\>
1818
- IAttributeHandler
1919

20-
Adds an `enum` keyword for the indicated values.
21-
22-
## Remarks
23-
24-
For NativeAOT scenarios, only primitive JSON types are supported.
2520

2621
## Methods
2722

2823
### AddConstraints(SchemaGenerationContextBase context, Attribute attribute)
2924

30-
Processes the type and any attributes (present on the context), and adds
31-
intents to the context.
3225

3326
#### Declaration
3427

3528
```c#
3629
public void AddConstraints(SchemaGenerationContextBase context, Attribute attribute)
3730
```
3831

39-
| Parameter | Type | Description |
40-
|---|---|---|
41-
| context | SchemaGenerationContextBase | The generation context. |
42-
| attribute | Attribute | The attribute. |
43-
44-
45-
#### Remarks
46-
47-
A common pattern is to implement **Json.Schema.Generation.IAttributeHandler** on the
48-
attribute itself. In this case, the <paramref name="attribute" /> parameter
49-
will be the same instance as the handler and can likely be ignored.
5032

_docs/api/JsonSchema.Net.Generation.DataAnnotations/Base64StringAttributeAttributeHandler.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,4 @@ order: "10.06.001"
1919
- IAttributeHandler\<Base64StringAttribute\>
2020
- IAttributeHandler
2121

22-
Adds a `format` keyword with `base64`.
23-
24-
## Remarks
25-
26-
By default, `format` is an annotation only. No validation will occur unless configured to do so.
27-
28-
The `base64` format is defined by the OpenAPI 3.1 specification.
29-
30-
## Constructors
31-
32-
### Base64StringAttributeAttributeHandler()
33-
34-
Creates a new **Json.Schema.Generation.DataAnnotations.Base64StringAttributeAttributeHandler**.
35-
36-
#### Declaration
37-
38-
```c#
39-
public Base64StringAttributeAttributeHandler()
40-
```
41-
4222

_docs/api/JsonSchema.Net.Generation.DataAnnotations/DeniedValuesAttributeHandler.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,16 @@ order: "10.06.003"
1717
- IAttributeHandler\<DeniedValuesAttribute\>
1818
- IAttributeHandler
1919

20-
Adds a `not: {enum}` construct for the indicated values.
21-
22-
## Remarks
23-
24-
For NativeAOT scenarios, only primitive JSON types are supported.
2520

2621
## Methods
2722

2823
### AddConstraints(SchemaGenerationContextBase context, Attribute attribute)
2924

30-
Processes the type and any attributes (present on the context), and adds
31-
intents to the context.
3225

3326
#### Declaration
3427

3528
```c#
3629
public void AddConstraints(SchemaGenerationContextBase context, Attribute attribute)
3730
```
3831

39-
| Parameter | Type | Description |
40-
|---|---|---|
41-
| context | SchemaGenerationContextBase | The generation context. |
42-
| attribute | Attribute | The attribute. |
43-
44-
45-
#### Remarks
46-
47-
A common pattern is to implement **Json.Schema.Generation.IAttributeHandler** on the
48-
attribute itself. In this case, the <paramref name="attribute" /> parameter
49-
will be the same instance as the handler and can likely be ignored.
5032

_docs/api/JsonSchema.Net.Generation.DataAnnotations/LengthAttributeHandler.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,16 @@ order: "10.06.007"
1717
- IAttributeHandler\<LengthAttribute\>
1818
- IAttributeHandler
1919

20-
Adds `minLength` and `maxLength` keywords.
21-
22-
## Remarks
23-
24-
`minLength` will be not be added if the value is less than or equal to zero.
2520

2621
## Methods
2722

2823
### AddConstraints(SchemaGenerationContextBase context, Attribute attribute)
2924

30-
Processes the type and any attributes (present on the context), and adds
31-
intents to the context.
3225

3326
#### Declaration
3427

3528
```c#
3629
public void AddConstraints(SchemaGenerationContextBase context, Attribute attribute)
3730
```
3831

39-
| Parameter | Type | Description |
40-
|---|---|---|
41-
| context | SchemaGenerationContextBase | The generation context. |
42-
| attribute | Attribute | The attribute. |
43-
44-
45-
#### Remarks
46-
47-
A common pattern is to implement **Json.Schema.Generation.IAttributeHandler** on the
48-
attribute itself. In this case, the <paramref name="attribute" /> parameter
49-
will be the same instance as the handler and can likely be ignored.
5032

_docs/api/JsonSchema.Net/JsonSchemaBuilderExtensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ public static JsonSchemaBuilder Pattern(this JsonSchemaBuilder builder, Regex pa
11541154
| Parameter | Type | Description |
11551155
|---|---|---|
11561156
| builder | JsonSchemaBuilder | The builder. |
1157-
| pattern | Regex | The pattern to match. |
1157+
| pattern | Regex | The Regex instance to match. |
11581158

11591159

11601160
#### Returns

_docs/api/JsonSchema.Net/JsonSchemaExtensions.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ public static IReadOnlyList<JsonSchema> GetOneOf(this JsonSchema schema)
756756

757757
### GetPattern(this JsonSchema schema)
758758

759-
Gets the value of `pattern` if the keyword exists.
759+
Gets the Regex of `pattern` if the keyword exists.
760760

761761
#### Declaration
762762

@@ -784,6 +784,36 @@ public static IReadOnlyDictionary<Regex, JsonSchema> GetPatternProperties(this J
784784

785785

786786

787+
### GetPatternPropertiesValues(this JsonSchema schema)
788+
789+
Gets the schemas in `patternProperties` if the keyword exists.
790+
791+
#### Declaration
792+
793+
```c#
794+
public static IReadOnlyDictionary<string, JsonSchema> GetPatternPropertiesValues(this JsonSchema schema)
795+
```
796+
797+
798+
#### Returns
799+
800+
801+
802+
### GetPatternValue(this JsonSchema schema)
803+
804+
Gets the value of `pattern` if the keyword exists.
805+
806+
#### Declaration
807+
808+
```c#
809+
public static string GetPatternValue(this JsonSchema schema)
810+
```
811+
812+
813+
#### Returns
814+
815+
816+
787817
### GetPrefixItems(this JsonSchema schema)
788818

789819
Gets the schemas in `prefixItems` if the keyword exists.

_docs/api/JsonSchema.Net/PatternKeyword.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ Handles `pattern`.
2828

2929
| Name | Type | Summary |
3030
|---|---|---|
31-
| **InvalidPattern** | string | If the pattern is invalid or unsupported by **System.Text.RegularExpressions.Regex**, it will appear here. |
32-
| **Value** | Regex | The regular expression. |
31+
| **InvalidPattern** | string | |
32+
| **Pattern** | string | The regular expression. |
33+
| **Value** | Regex | Returns the Regex Value of the keyword. |
3334

3435
## Constructors
3536

3637
### PatternKeyword(Regex value)
3738

38-
Creates a new **Json.Schema.PatternKeyword**.
39+
Creates a new **Json.Schema.PatternKeyword** based on a regular expression instance.
3940

4041
#### Declaration
4142

@@ -45,7 +46,22 @@ public PatternKeyword(Regex value)
4546

4647
| Parameter | Type | Description |
4748
|---|---|---|
48-
| value | Regex | The regular expression. |
49+
| value | Regex | |
50+
51+
52+
### PatternKeyword(string pattern)
53+
54+
Creates a new **Json.Schema.PatternKeyword** based on a regular expression pattern.
55+
56+
#### Declaration
57+
58+
```c#
59+
public PatternKeyword(string pattern)
60+
```
61+
62+
| Parameter | Type | Description |
63+
|---|---|---|
64+
| pattern | string | |
4965

5066

5167
## Methods

_docs/api/JsonSchema.Net/PatternPropertiesKeyword.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,40 @@ Handles `patternProperties`.
2929

3030
| Name | Type | Summary |
3131
|---|---|---|
32-
| **InvalidPatterns** | IReadOnlyList\<string\> | If any pattern is invalid or unsupported by **System.Text.RegularExpressions.Regex**, it will appear here. |
33-
| **Patterns** | IReadOnlyDictionary\<Regex, JsonSchema\> | The pattern-keyed schemas. |
32+
| **InvalidPatterns** | IReadOnlyList\<string\> | |
33+
| **Patterns** | IReadOnlyDictionary\<Regex, JsonSchema\> | The regex patterns of this PatternPropertiesKeyword |
34+
| **PatternValues** | IReadOnlyDictionary\<string, JsonSchema\> | The pattern values of this PatternPropertiesKeyword |
3435

3536
## Constructors
3637

37-
### PatternPropertiesKeyword(IReadOnlyDictionary\<Regex, JsonSchema\> values)
38+
### PatternPropertiesKeyword(IEnumerable\<KeyValuePair\<string, JsonSchema\>\> values)
3839

3940
Creates a new **Json.Schema.PatternPropertiesKeyword**.
4041

4142
#### Declaration
4243

4344
```c#
44-
public PatternPropertiesKeyword(IReadOnlyDictionary<Regex, JsonSchema> values)
45+
public PatternPropertiesKeyword(IEnumerable<KeyValuePair<string, JsonSchema>> values)
4546
```
4647

4748
| Parameter | Type | Description |
4849
|---|---|---|
49-
| values | IReadOnlyDictionary\<Regex, JsonSchema\> | The pattern-keyed schemas. |
50+
| values | IEnumerable\<KeyValuePair\<string, JsonSchema\>\> | The pattern-keyed schemas. |
51+
52+
53+
### PatternPropertiesKeyword(IEnumerable\<KeyValuePair\<Regex, JsonSchema\>\> values)
54+
55+
Creates a new **Json.Schema.PatternPropertiesKeyword**.
56+
57+
#### Declaration
58+
59+
```c#
60+
public PatternPropertiesKeyword(IEnumerable<KeyValuePair<Regex, JsonSchema>> values)
61+
```
62+
63+
| Parameter | Type | Description |
64+
|---|---|---|
65+
| values | IEnumerable\<KeyValuePair\<Regex, JsonSchema\>\> | The pattern-keyed schemas. |
5066

5167

5268
## Methods

_docs/api/JsonSchema.Net/RegexFormat.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ public RegexFormat(string key, string regex)
4040
| regex | string | The regular expression. |
4141

4242

43+
### RegexFormat(string key, Regex regex)
44+
45+
Creates a new **Json.Schema.RegexFormat**.
46+
47+
#### Declaration
48+
49+
```c#
50+
public RegexFormat(string key, Regex regex)
51+
```
52+
53+
| Parameter | Type | Description |
54+
|---|---|---|
55+
| key | string | The format key. |
56+
| regex | Regex | The regular expression. |
57+
58+
4359
## Methods
4460

4561
### Validate(JsonNode node, out string errorMessage)

_docs/api/JsonSchema.Net/title.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ bookmark: JsonSchema.Net
44
permalink: /api/JsonSchema.Net/:title/
55
folder: true
66
order: "10.01"
7-
version: "7.1.2"
7+
version: "7.2.0"
88
---

_docs/release-notes/rn-json-schema.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ title: JsonSchema.Net
44
icon: fas fa-tag
55
order: "09.01"
66
---
7+
# [7.2.0](https://github.com/gregsdennis/json-everything/pull/776) {#release-schema-7.2.0}
8+
9+
[#773](https://github.com/gregsdennis/json-everything/issues/773) - [@rikbosch](https://github.com/rikbosch) recommended and patched a performance improvement around regular expression handling.
10+
11+
Adds new methods which access patterns with strings instead of `Regex` instances. This allows the `Regex` class to handle caching, which can reduce memory usage in various cases including using the same patterns across multiple schemas.
12+
13+
> `PatternKeyword.InvalidPattern` and `PatternProperties.InvalidPatterns` are no longer used. Deserialization of invalid patterns will now throw `RegexParseException`, which aligns better with the `JsonSchemaBuilder` experience (invalid patterns passed to `.Pattern()` or `.PatternProperties` will not compile).
14+
{: .prompt-warning }
15+
716
# [7.1.2](https://github.com/gregsdennis/json-everything/pull/759) {#release-schema-7.1.2}
817

918
Update to use _JsonPointer.Net_ v5.0.2.

0 commit comments

Comments
 (0)