| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Text.Json.Nodes; |
| | | 5 | | |
| | | 6 | | namespace System.Text.Json.Schema |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Configures the behavior of the <see cref="JsonSchemaExporter"/> APIs. |
| | | 10 | | /// </summary> |
| | | 11 | | public sealed class JsonSchemaExporterOptions |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Gets the default configuration object used by <see cref="JsonSchemaExporter"/>. |
| | | 15 | | /// </summary> |
| | 0 | 16 | | public static JsonSchemaExporterOptions Default { get; } = new(); |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Determines whether non-nullable schemas should be generated for null oblivious reference types. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <remarks> |
| | | 22 | | /// Defaults to <see langword="false"/>. Due to restrictions in the run-time representation of nullable referenc |
| | | 23 | | /// most occurrences are null oblivious and are treated as nullable by the serializer. A notable exception to th |
| | | 24 | | /// are nullability annotations of field, property and constructor parameters which are represented in the contr |
| | | 25 | | /// </remarks> |
| | 0 | 26 | | public bool TreatNullObliviousAsNonNullable { get; init; } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Defines a callback that is invoked for every schema that is generated within the type graph. |
| | | 30 | | /// </summary> |
| | 0 | 31 | | public Func<JsonSchemaExporterContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; } |
| | | 32 | | } |
| | | 33 | | } |