JsonSchema.Net.Generation
Adds attribute-related schema elements.
Adds a handler for a custom attribute that cannot be made to implement .
The handler type.
Adds a handler for a custom attribute that cannot be made to implement .
The handler.
Removes a handler type.
The handler type.
Applies an `additionalProperties` keyword.
If the attribute value represents a boolean schema, gets the boolean value.
If the attribute value represents a type schema, gets the type.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
A boolean schema.
Creates a new instance.
A type to generate a schema for the keyword.
Applies an `additionalProperties` keyword.
If the attribute value represents a boolean schema, gets the boolean value.
If the attribute value represents a type schema, gets the type.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
A boolean schema.
Creates a new instance.
A type to generate the a schema for the keyword.
Serves as a base class for attributes which support conditional schema generation.
Identifies the condition group under which this attribute applies.
Applies a `const` keyword.
The value.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Applies a `default` keyword.
The value.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Creates a new instance.
The value.
Applies a `description` keyword.
The description.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies an `exclusiveMaximum` keyword.
The `value` parameter is provided in the constructor as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
The exclusive maximum.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
The parameter is provided as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
Applies an `exclusiveMinimum` keyword.
The `value` parameter is provided in the constructor as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
The exclusive minimum.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
The parameter is provided as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
Applies an `$id` keyword.
The regular expression pattern.
Creates a new instance.
The value.
Creates or amends a condition group by expecting a value in a property.
The property name.
The expected property value.
The compiler will allow any compile-time constant, however only JSON-compatible
values will work.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates a new instance.
The name of the property.
The expected value for the property.
The condition group.
Creates multiple condition groups based on the value of an enum property, one group for each defined enum value.
The enum type is inferred from the property.
The property name.
Gets or sets whether to use numbers or names in the condition. Default is to use names.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The property name.
(optional) Whether to use numbers or names in the condition. Default is to use names.
Creates or amends a condition group by defining an expected maximum value in a property.
The specific keywords which are added depend on the type of the targeted property.
The property name.
The expected maximum value.
Gets or sets whether the value should be exclusive.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The name of the property.
The expected maximum value for the property.
The condition group.
The parameter is provided as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted
when applied as the `maximum` or `exclusiveMaximum` keywords.
Creates or amends a condition group by defining an expected minimum value in a property.
The specific keywords which are added depend on the type of the targeted property.
The property name.
The expected minimum value.
Gets or sets whether the value should be exclusive.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The name of the property.
The expected minimum value for the property.
The condition group.
The parameter is provided as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted
when applied as the `minimum` or `exclusiveMinimum` keywords.
Indicates an attribute can support being applied to generic parameters.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Default MUST be -1, which indicates the root type.
For example, `Person` in `Dictionary<string, Person>` would have a parameter of 1.
Indicates that the property should be excluded from generation.
This attribute functions exactly the same as the . It
is included separately to support the case where the model should be serialized with
a property or enum member but schema generation should ignore it.
Initializes a new instance of .
Handler for the .
Processes the type and any attributes (present on the context), and adds
intents to the context.
The generation context.
Applies a `maximum` keyword.
The `value` parameter is provided in the constructor as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
The maximum.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
The parameter is provided as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
Applies an `maxItems` keyword.
The maximum number of items.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies a `maxLength` keyword.
The maximum length.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies a `minimum` keyword.
The `value` parameter is provided in the constructor as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
The minimum.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
The parameter is provided as a `double` but stored as a `decimal`
because `decimal` is not a valid attribute parameter type.
As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted.
Applies a `minItems` keyword.
The minimum number of items.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies a `minimum` keyword.
The minimum length.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies a `multipleOf` keyword.
The divisor.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Overrides the nullability declared in code and either adds or removes `null` in the `type` keyword.
Gets whether `null` should be included in the `type` keyword.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
Whether `null` should be included in the `type` keyword.
Applies a `pattern` keyword.
The regular expression pattern.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies a `readOnly` keyword.
Whether the property should be read-only.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance with a value of `true`.
Creates a new instance.
The value.
Indicates a property is required and should be listed in the
`required` keyword.
Applies a `title` keyword.
The title.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies a `uniqueItems` keyword.
Whether the items should be unique.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance.
The value.
Applies a `writeOnly` keyword.
Whether the property should be write-only.
The index of the parameter to which the attribute should apply. Default is -1 to indicate the root.
Creates a new instance with a value of `true`.
Creates a new instance.
The value.
Extension methods for context objects.
Gets the attribute set. Type contexts get type attributes; member context
get member attributes.
The context.
The attribute set.
Thrown for other context types.
Tracks the available generators.
Registers a new generator.
The generator.
Registration is order dependent: last one wins. If you have multiple generators which
can handle a given type, the last one registered will be used.
Defines a generator.
Generators are the first stage of schema generation. These will add keyword intents
to the context, which then are translated into keywords after optimization.
Implementations MUST also override
Determines whether the generator can be used to generate a schema for this type.
The type.
`true` if the generator can be used; `false` otherwise.
Processes the type and any attributes (present on the context), and adds
intents to the context.
The generation context.
Defines requirements to handle converting an attribute to a keyword intent.
Processes the type and any attributes (present on the context), and adds
intents to the context.
The generation context.
The attribute.
A common pattern is to implement on the
attribute itself. In this case, the parameter
will be the same instance as the handler and can likely be ignored.
Processes attributes of type that are present on a
type or member and adds intents to the context.
The type of the attribute that is handled.
Provides intent to create an `additionalItems` keyword.
The context that represents the inner requirements.
Creates a new instance.
The context.
Applies the keyword to the .
The builder.
Provides intent to create an `additionalProperties` keyword.
The context that represents the inner requirements.
Creates a new instance.
The context.
Applies the keyword to the .
The builder.
Provides intent to create a `allOf` keyword.
Gets the subschemas to include.
Creates a new instance of the class.
The subschemas to include.
Creates a new instance of the class.
The subschemas to include.
Applies the keyword to the .
The builder.
Provides intent to create a `anyOf` keyword.
Gets the subschemas to include.
Creates a new instance of the class.
The subschemas to include.
Creates a new instance of the class.
The subschemas to include.
Applies the keyword to the .
The builder.
Provides intent to create a `const` keyword.
The expected value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `default` keyword.
The expected value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `$defs` keyword.
The contexts that represent the definitions.
Creates a new instance.
The contexts.
Applies the keyword to the .
The builder.
Provides intent to create a `deprecated` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `description` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create an `else` keyword.
A set of intents used to define the subschema.
Creates a new instance.
Applies the keyword to the .
The builder.
Provides intent to create an `enum` keyword.
The names defined by the enumeration.
Creates a new instance.
The names defined by the enumeration.
Creates a new instance.
The names defined by the enumeration.
Creates a new instance.
The values defined by the enumeration.
Creates a new instance.
The values defined by the enumeration.
Applies the keyword to the .
The builder.
Provides intent to create an `exclusiveMaximum` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create an `exclusiveMinimum` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `format` keyword.
The format.
Creates a new instance.
The format.
Applies the keyword to the .
The builder.
Provides intent to create an `$id` keyword.
The URI to use as the schema's ID.
Creates a new instance.
Applies the keyword to the .
The builder.
Provides intent to create an `if` keyword.
A set of intents used to define the subschema.
Creates a new instance.
Applies the keyword to the .
The builder.
Provides intent to create an `items` keyword.
The context that represents the inner requirements.
Creates a new instance.
The context.
Applies the keyword to the .
The builder.
Provides intent to create a `maximum` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `maxItems` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `maxLength` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `maxProperties` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `minimum` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `minItems` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `minLength` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `minProperties` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `multipleOf` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create an `if` keyword.
A set of intents used to define the subschema.
Creates a new instance.
Applies the keyword to the .
The builder.
Provides intent to create a `pattern` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create an `additionalProperties` keyword.
The contexts that represent the properties.
Creates a new instance.
The contexts.
Applies the keyword to the .
The builder.
Provides intent to create a `propertyNames` keyword.
The context that represents the inner requirements.
Creates a new instance.
The context.
Applies the keyword to the .
The builder.
Provides intent to create a `readOnly` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `$ref` keyword.
The reference.
Creates a new instance.
The reference.
Creates a new instance.
The context that holds this reference.
The reference.
Applies the keyword to the .
The builder.
Provides intent to create a `required` keyword.
The required property names.
Creates a new instance.
The required property names.
Applies the keyword to the .
The builder.
Provides intent to create a `then` keyword.
A set of intents used to define the subschema.
Creates a new instance.
Applies the keyword to the .
The builder.
Provides intent to create a `title` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `type` keyword.
The type.
Creates a new instance.
The type.
Applies the keyword to the .
The builder.
Provides intent to create an `unevaluatedProperties` keyword.
The context that represents the inner requirements.
Creates a new instance.
The context, or null to apply the false schema.
Applies the keyword to the .
The builder.
Provides intent to create a `uniqueItems` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Provides intent to create a `writeOnly` keyword.
The value.
Creates a new instance.
The value.
Applies the keyword to the .
The builder.
Describes the intent to create a keyword.
Because is immutable, the system cannot
generate the schema directly as it needs to do some optimization
first. Keyword intents allow this. They record all of the data
needed by the keyword. Application involves translating the
intent into an actual keyword on the
using one of the fluent extension methods provided by
. Custom intents
will need to be applied from within custom
implementations.
Implementations MUST also override
Applies the keyword to the .
The builder.
Describes a schema generation refiner.
Refiners run after attributes have been processed, before the
schema itself is created. This is used to add customization
logic.
Determines if the refiner should run.
Runs the refiner.
Allows custom `$defs` key naming functionality.
Generates a `$defs` key for a type.
The type.
A string to use for the type; null to use the library-provided behavior.
Provides extension methods for schema generation.
Generates a schema from a CLR type.
The type to generate.
The schema builder.
The generator configuration.
The schema builder (for fluent syntax support).
Generates a schema from a CLR type.
The schema builder.
The type to generate.
The generator configuration.
The schema builder (for fluent syntax support).
Provides context for object members to include those attributes.
The type.
Gets the context this is based on.
Gets the set of member attributes.
Indicates whether the member is marked as a nullable reference type.
Gets or sets the generic parameter that this context represents.
A null value (default) represents the root type.
Declares a property name resolution which is used to provide a property name.
The property.
The property name
Defines a set of predefined property name resolution methods.
Makes no changes. Properties are generated with the name of the property in code.
Property names to camel case (e.g. `camelCase`).
Property names to pascal case (e.g. `PascalCase`).
Property names to snake case (e.g. `Snake_Case`).
Property names to lower snake case (e.g. `lower_snake_case`).
Property names to upper snake case (e.g. `UPPER_SNAKE_CASE`).
Property names to kebab case (e.g. `Kebab-Case`).
Property names to upper kebab case (e.g. `UPPER-KEBAB-CASE`).
Indicates the sequence in which properties will be listed in the schema.
Properties will be listed in the order they're declared in code.
Properties will be sorted by name, case-insensitive.
Provides base functionality and data for generation contexts.
Represents a true schema.
Represents a false schema.
The type.
The keyword intents required for this type.
Applies the keyword to the .
The schema builder.
The schema builder (for fluent syntax support).
Gets the contexts for the current run.
Gets or creates a based on the given
type and attribute set.
The type to generate.
A generation context, from the cache if one exists with the specified
type and attribute set; otherwise a new one. New contexts are automatically
cached.
Use this in your generator if it needs to create keywords with subschemas.
Provides additional configuration for the generator.
Thread-static storage of the current configuration. Only to be used for reading
the configuration. Setting values on this object will be overwritten when starting
generation.
A collection of refiners.
A collection of generators in addition to the global set.
Gets or sets the order in which properties will be listed in the schema.
Gets or sets the property name resolving method. Default is .
This can be replaced with any `Func<MemberInfo, string>`.
Gets or sets whether properties that are affected by conditionals are defined
globally or only within their respective `then` subschemas. True restricts
those property definitions to `then` subschemas and adds a top-level
`unevaluatedProperties: false`; false (default) defines them globally.
Allows mapping of types to external schema `$id`s. When encountering one
of these types, a `$ref` keyword will be generated instead of a full schema.
Provides custom naming functionality.
Creates a new .
Registers an assembly's XML comment file.
Any type in the assembly.
The file name of the XML file.
Provides informative methods for types.
Determines whether the type is a simple, one-dimensional, non-keyed collection.
The type.
true if the type represents an array; false otherwise.
Determines if the type is a nullable value type, i.e. .
The type
True if the type is ; false otherwise.
Determines if the type is a nullable value type, i.e. .
The type
True if the type is ; false otherwise.
Provides a context for generating schemas for types.
The type.
The number of times this context has been referenced.
Base class for comments classes
"summary" comment
"remarks" comment
"example" comment
Helper class that reads XML documentation generated by C# compiler from code comments.
Dictionary of XML navigators for multiple assemblies.
Function that returns path to XML documentation file for specified assembly.
Default value is true.
When it is set to true DocXmlReader removes leading spaces and an empty
lines at the end of the comment.
By default XML comments are indented for human readability but it adds
leading spaces that are not present in source code.
For example here is compiler generated XML documentation with '-'
showing spaces for readability.
----
----Text
----
With UnIndentText set to true returned summary text is just "Text"
With UnIndentText set to false returned summary text contains leading spaces
and the trailing empty line "\n----Text\n----"
Open XML documentation files based on assemblies of types. Comment file names
are generated based on assembly names by replacing assembly location with .xml.
Function that returns path to the assembly XML comment file.
If function is null then comments file is assumed to have the same file name as assembly.
If function returns null or if comments file does not exist then all comments for types from that
assembly would remain empty.
Returns comments for the class method. May return null object is comments for method
are missing in XML documentation file.
Returned comments tags:
Summary, Remarks, Parameters (if present), Responses (if present), Returns
Return null if comment for method is not available
Return Summary comments for specified type.
For Delegate types Parameters field may be returned as well.
TypeComment
Returns comments for specified class member.
Get enum type description and comments for enum values. If
is false and no comments exist for any value then ValueComments list is empty.
Enum type to get comments for. If this is not an enum type then functions throws an
ArgumentException
True if ValueComments list should be filled even if
none of the enum values have any summary comments
EnumComment
Enum type comments
"summary" comments of enum values. List contains names, values and
comments for each enum value.
If none of values have any summary comments then this list may be empty.
If at least one value has summary comment then this list contains
all enum values with empty comments for values without comments.
Comment of one enum value
The name of the enum value
Integer value of the enum
Debugging-friendly text.
Inheritdoc tag with optional cref attribute.
Cref attribute value. This value is optional.
Method, operator and constructor comments
"param" comments of the method. Each item in the list is the tuple
where Item1 is the "name" of the parameter in XML file and
Item2 is the body of the comment.
"returns" comment of the method.
"response" comments of the method. The list contains tuples where
Item1 is the "code" of the response and
Item1 is the body of the comment.
"typeparam" comments of the method. Each item in the list is the tuple
where Item1 is the "name" of the parameter in XML file and
Item2 is the body of the comment.
Class, Struct or delegate comments
This list contains descriptions of delegate type parameters.
For non-delegate types this list is empty.
For delegate types this list contains tuples where
Item1 is the "param" item "name" attribute and
Item2 is the body of the comment
"returns" comment of the method.
Class that constructs IDs for XML documentation comments.
IDs uniquely identify comments in the XML documentation file.
Type member XML ID prefix.
Field name XML ID prefix.
Property name XML ID prefix.
Event XML ID prefix.
Type name XML ID prefix.
Part of the constructor XML tag in XML document.
Get XML Id of the type definition.
Get XML Id of a class method
Get XML Id of any member of the type.
Get XML Id of property
Get XML Id of field
Get XML Id of event field
Get XML Id of specified value of the enum type.
Enum type
The name of the value without type and namespace
Gets the type's full name prepared for xml documentation format.
The type.
Whether the declaring member for this type is an out directional parameter.
If the type is being used has a method parameter.
The names of the generic class parameters from the parent type.
The full name.
Get method element Id in XML document
Return true if this method is actually an indexer property.
Explicit/implicit operator may have return value appended to the name.
Get method name. Some methods have special names or like generic methods some extra information.