Home DialectExtensions Class
DialectExtensions Class
Cancel

DialectExtensions Class

Namespace: Json.Schema

Inheritance: DialectExtensions 🡒 object

Provides extension methods for creating modified instances of the Json.Schema.Dialect type by adding or removing keyword handlers.

Methods

With(this Dialect dialect, Uri id, FormatRegistry formatRegistry)

Creates a new Dialect instance by extending the specified dialect with a new format registry.

Declaration

1
public static Dialect With(this Dialect dialect, Uri id, FormatRegistry formatRegistry)
ParameterTypeDescription
dialectDialectThe base Dialect to extend. Cannot be null.
idUriAn optional identifier for the new Dialect.
formatRegistryFormatRegistryAn optional format registry to use with the new Dialect. If null, the registry from the base dialect is used.

Returns

A new Dialect instance containing the combined keyword handlers and configuration settings.

Remarks

This method is useful for creating customized dialects based on an existing one, allowing selective

With(this Dialect dialect, IEnumerable<IKeywordHandler> add, Uri id, bool? refIgnoresSiblingKeywords, bool? allowUnknownKeywords, FormatRegistry formatRegistry)

Creates a new Dialect instance by extending the specified dialect with additional keyword handlers and optional configuration overrides.

Declaration

1
public static Dialect With(this Dialect dialect, IEnumerable<IKeywordHandler> add, Uri id, bool? refIgnoresSiblingKeywords, bool? allowUnknownKeywords, FormatRegistry formatRegistry)
ParameterTypeDescription
dialectDialectThe base Dialect to extend. Cannot be null.
addIEnumerable<IKeywordHandler>A collection of keyword handlers to add to the new Dialect. Cannot be null.
idUriAn optional identifier for the new Dialect.
refIgnoresSiblingKeywordsbool?An optional value indicating whether ‘$ref’ keywords ignore sibling keywords. If null, the value from the base
allowUnknownKeywordsbool?An optional value indicating whether unknown keywords are allowed. If null, the value from the base dialect is
formatRegistryFormatRegistryAn optional format registry to use with the new Dialect. If null, the registry from the base dialect is used.

Returns

A new Dialect instance containing the combined keyword handlers and configuration settings.

Remarks

This method is useful for creating customized dialects based on an existing one, allowing selective

Without(this Dialect dialect, IEnumerable<IKeywordHandler> remove, Uri id, bool? refIgnoresSiblingKeywords, bool? allowUnknownKeywords)

Creates a new Dialect instance by removing the specified keyword handlers from the given dialect.

Declaration

1
public static Dialect Without(this Dialect dialect, IEnumerable<IKeywordHandler> remove, Uri id, bool? refIgnoresSiblingKeywords, bool? allowUnknownKeywords)
ParameterTypeDescription
dialectDialectThe source Dialect from which keyword handlers will be removed.
removeIEnumerable<IKeywordHandler>A collection of keyword handlers to exclude from the resulting Dialect. Each handler in this collection will be
idUriAn optional identifier to assign to the new Dialect. If null, the identifier from the source dialect is not set.
refIgnoresSiblingKeywordsbool?An optional value indicating whether ‘$ref’ should ignore sibling keywords in the new Dialect. If null, the value
allowUnknownKeywordsbool?An optional value indicating whether unknown keywords are allowed in the new Dialect. If null, the value from the

Returns

A new Dialect instance with the specified keyword handlers removed and updated configuration options as provided.

Remarks

The returned Dialect retains all configuration options from the source dialect unless overridden by

Contents