Home SchemaGenerationContextCache Class
SchemaGenerationContextCache Class
Cancel

SchemaGenerationContextCache Class

Namespace: Json.Schema.Generation

Inheritance: SchemaGenerationContextCache 🡒 object

Gets the contexts for the current run.

Methods

Get(Type type, List<Attribute> memberAttributes)

Gets or creates a Json.Schema.Generation.SchemaGenerationContextBase based on the given type and attribute set.

Declaration

1
public static SchemaGenerationContextBase Get(Type type, List<Attribute> memberAttributes)
ParameterTypeDescription
typeTypeThe type to generate.
memberAttributesList<Attribute>A collection of extra attributes. Only use if requesting a context to represent a member.

Returns

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. If is null or empty, a Json.Schema.Generation.TypeGenerationContext will be returned; otherwise a Json.Schema.Generation.MemberGenerationContext.

Remarks

Use this in your generator if it needs to create keywords with subschemas.

Contents