Class JsonSchemaOptions
- Namespace
- ShapeShift.Json
- Assembly
- ShapeShift.Json.dll
Options that influence how a DataContract is projected onto JSON Schema.
public record JsonSchemaOptions : IEquatable<JsonSchemaOptions>
- Inheritance
-
JsonSchemaOptions
- Implements
- Inherited Members
Properties
AllowNamedFloatingPointValues
Gets a value indicating whether floating point schemas also accept
the "NaN", "Infinity" and "-Infinity" string literals.
public bool AllowNamedFloatingPointValues { get; init; }
Property Value
Remarks
Set this to match AllowNamedFloatingPointValues. GetJsonSchema<T>(JsonSchemaOptions?) does so automatically when the caller does not specify options.
Default
Gets the options used when the caller does not supply any.
public static JsonSchemaOptions Default { get; }
Property Value
IncludeComments
Gets a value indicating whether schemas include $comment keywords
that explain representation choices that JSON Schema cannot express.
public bool IncludeComments { get; init; }
Property Value
IncludeSchemaKeyword
Gets a value indicating whether the root schema carries a $schema keyword
that identifies the JSON Schema dialect.
public bool IncludeSchemaKeyword { get; init; }
Property Value
Limits
Gets the limits that the serializer enforces, which are projected onto
maxItems, maxLength and similar keywords.
public JsonSchemaLimits? Limits { get; init; }
Property Value
- JsonSchemaLimits?
The default is null, which omits all limit keywords.
Remarks
Limits are opt-in because they describe a particular deserializer's configuration rather than the data contract itself.
Profile
Gets the serialization format that the generated schema describes.
public JsonSchemaProfile Profile { get; init; }
Property Value
- JsonSchemaProfile
The default is Json.