Skip to content

Commit ebfa5c0

Browse files
author
json-everything-ci
committed
regenerated api docs
1 parent a1254d8 commit ebfa5c0

7 files changed

Lines changed: 38 additions & 93 deletions

File tree

_docs/api/JsonSchema.Net.Api/Extensions.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,45 @@ order: "10.05.000"
1212
🡒
1313
`object`
1414

15-
Provides extension methods for configuring JSON Schema validation in ASP.NET Core MVC applications.
15+
Provides extension methods for configuring JSON Schema validation in ASP.NET Core applications.
1616

1717
## Remarks
1818

19-
The extension methods in this class enable integration of JSON Schema-based validation into the MVC
20-
request pipeline. These methods are intended to be used during application startup to add model validation based on
21-
JSON Schema definitions. All methods are static and designed for use with dependency injection and MVC configuration
19+
The extension methods in this class enable integration of JSON Schema-based validation into MVC and
20+
minimal API request handling. These methods are intended to be used during application startup to add model
21+
validation based on JSON Schema definitions. All methods are static and designed for use with dependency injection
2222

2323
## Methods
2424

25+
### AddJsonSchemaValidation(this IServiceCollection services, Action\<GenerativeValidatingJsonConverter\> configure)
26+
27+
Enables JSON Schema-based validation for minimal APIs by configuring HTTP JSON serializer options.
28+
29+
#### Declaration
30+
31+
```c#
32+
public static IServiceCollection AddJsonSchemaValidation(this IServiceCollection services, Action<GenerativeValidatingJsonConverter> configure)
33+
```
34+
35+
| Parameter | Type | Description |
36+
|---|---|---|
37+
| services | IServiceCollection | The service collection to configure. Cannot be null. |
38+
| configure | Action\<GenerativeValidatingJsonConverter\> | An optional delegate to configure the generative JSON schema validation converter. If null, default settings are |
39+
40+
41+
#### Returns
42+
43+
The same **Microsoft.Extensions.DependencyInjection.IServiceCollection** instance so that additional configuration calls can be chained.
44+
45+
#### Remarks
46+
47+
By default, source generation is used to create schemas at compile time from types decorated with `[GenerateJsonSchema]`.
48+
When using source generation, settings like property naming, property order, and strict conditionals must be configured on the
49+
`[GenerateJsonSchema]` attribute itself. The **Json.Schema.Generation.Serialization.GenerativeValidatingJsonConverter.GeneratorConfiguration** settings
50+
only affect runtime schema generation, which occurs when source generation is disabled or when using `[JsonSchema]` attributes.
51+
To disable source generation, add `&lt;DisableJsonSchemaSourceGeneration&gt;true&lt;/DisableJsonSchemaSourceGeneration&gt;`
52+
to your project file.
53+
2554
### AddJsonSchemaValidation(this IMvcBuilder builder, Action\<GenerativeValidatingJsonConverter\> configure)
2655

2756
Enables JSON Schema-based validation for MVC controllers by adding the necessary filters and model binders to the

_docs/api/JsonSchema.Net.Api/title.md

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

_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 & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,19 @@ 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

4323
## Methods
4424

4525
### Apply(JsonSchemaBuilder builder)
4626

47-
Applies constraints for source generation.
4827

4928
#### Declaration
5029

5130
```c#
5231
public static JsonSchemaBuilder Apply(JsonSchemaBuilder builder)
5332
```
5433

55-
| Parameter | Type | Description |
56-
|---|---|---|
57-
| builder | JsonSchemaBuilder | The schema builder. |
58-
5934

6035
#### Returns
6136

62-
The builder for chaining.
6337

_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 & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,29 @@ 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

5133
### Apply(JsonSchemaBuilder builder, int minimumLength, int maximumLength)
5234

53-
Applies constraints for source generation.
5435

5536
#### Declaration
5637

5738
```c#
5839
public static JsonSchemaBuilder Apply(JsonSchemaBuilder builder, int minimumLength, int maximumLength)
5940
```
6041

61-
| Parameter | Type | Description |
62-
|---|---|---|
63-
| builder | JsonSchemaBuilder | The schema builder. |
64-
| minimumLength | int | The minimum length. |
65-
| maximumLength | int | The maximum length. |
66-
6742

6843
#### Returns
6944

70-
The builder for chaining.
7145

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: JsonSchema.Net
44
icon: fas fa-tag
55
order: "09.055"
66
---
7+
# [1.1.0](https://github.com/gregsdennis/json-everything/pull/1013) {#release-schemaapi-1.0.3}
8+
9+
Updated nuget packages & EULA.
10+
711
# [1.0.3](https://github.com/gregsdennis/json-everything/pull/1013) {#release-schemaapi-1.0.3}
812

913
Updated nuget packages & EULA.

0 commit comments

Comments
 (0)