Skip to content

Commit aa1c7b6

Browse files
authored
Merge pull request #19 from json-everything/schema/multithread-warning
add multithreaded warning for validating serializer with varying options
2 parents d43f012 + be49b20 commit aa1c7b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

_docs/schema/serialization.md

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ The validation can be configured using properties on the converter.
4848
- `OutputFormat` configures the JSON Schema output format to be used. By default, this value is `Flag` (the same as on `EvaluationOptions`).
4949
- `RequireFormatValidation` will validate the `format` keyword when set to true. By default `format` is an annotation.
5050

51+
> The `ValidatingJsonConverter` is a factory that creates individual typed converters and caches them. Be aware, however, that when a typed converter is used, its options are overwritten with the options you've set on the factory. This has a side effect of rendering the typed converter unsafe in multithreaded environments when using varying options. It'll be fine if you always use the same options, however.
52+
{: .prompt-warning }
53+
5154
## Declaring a JSON Schema for a type {#schema-deserialization-attribute-usage}
5255

5356
To declare a JSON Schema for any type, it needs to be decorated with the `[JsonSchema()]` attribute.

0 commit comments

Comments
 (0)