Home SchemaKeywordRegistry Class
SchemaKeywordRegistry Class
Cancel

SchemaKeywordRegistry Class

Namespace: Json.Schema

Inheritance: SchemaKeywordRegistry 🡒 object

Manages which keywords are known by the system.

Remarks

Because the deserialization process relies on keywords being registered, this class cannot be an instance class like the other registries in this library. Therefore keywords are registered for all schemas.

Methods

GetImplementationType(string keyword)

Gets the implementation for a given keyword name.

Declaration

1
public static Type GetImplementationType(string keyword)
ParameterTypeDescription
keywordstringThe keyword name.

Returns

The keyword type, if registered; otherwise null.

Register()

Registers a new keyword type.

Declaration

1
public static void Register()

Register(JsonSerializerContext typeContext)

Registers a new keyword type.

Declaration

1
public static void Register(JsonSerializerContext typeContext)
ParameterTypeDescription
typeContextJsonSerializerContextJsonTypeInfo for the keyword type

RegisterNullValue(T nullKeyword)

Registers a null-value for a keyword.

Declaration

1
public static void RegisterNullValue(T nullKeyword)
ParameterTypeDescription
nullKeywordT 

Remarks

This is important for keywords that accept null, like default and const. Without this step, the serializer will skip keywords that have nulls.

Unregister()

Unregisters a keyword type.

Declaration

1
public static void Unregister()
Contents