Table of Contents

Class OpenApiSchemaSourceGenerationContext

Namespace
GenerativeAI.Tools
Assembly
GenerativeAI.Tools.dll

JSON source generation context for OpenApiSchema serialization.

[JsonSerializable(typeof(OpenApiSchema))]
[JsonSourceGenerationOptions(WriteIndented = true)]
public class OpenApiSchemaSourceGenerationContext : JsonSerializerContext, IJsonTypeInfoResolver
Inheritance
OpenApiSchemaSourceGenerationContext
Implements
Inherited Members
Extension Methods

Constructors

OpenApiSchemaSourceGenerationContext()

public OpenApiSchemaSourceGenerationContext()

OpenApiSchemaSourceGenerationContext(JsonSerializerOptions)

Creates an instance of JsonSerializerContext and binds it with the indicated JsonSerializerOptions.

public OpenApiSchemaSourceGenerationContext(JsonSerializerOptions options)

Parameters

options JsonSerializerOptions

The run time provided options for the context instance.

Properties

Boolean

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<bool> Boolean { get; }

Property Value

JsonTypeInfo<bool>

Default

The default JsonSerializerContext associated with a default JsonSerializerOptions instance.

public static OpenApiSchemaSourceGenerationContext Default { get; }

Property Value

OpenApiSchemaSourceGenerationContext

GeneratedSerializerOptions

The source-generated options associated with this context.

protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }

Property Value

JsonSerializerOptions

IReadOnlyDictionaryStringOpenApiSchema

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IReadOnlyDictionary<string, OpenApiSchema>> IReadOnlyDictionaryStringOpenApiSchema { get; }

Property Value

JsonTypeInfo<IReadOnlyDictionary<string, OpenApiSchema>>

IReadOnlyListString

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IReadOnlyList<string>> IReadOnlyListString { get; }

Property Value

JsonTypeInfo<IReadOnlyList<string>>

OpenApiSchema

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<OpenApiSchema> OpenApiSchema { get; }

Property Value

JsonTypeInfo<OpenApiSchema>

String

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<string> String { get; }

Property Value

JsonTypeInfo<string>

Methods

GetTypeInfo(Type)

Gets metadata for the specified type.

public override JsonTypeInfo? GetTypeInfo(Type type)

Parameters

type Type

The type to fetch metadata for.

Returns

JsonTypeInfo

The metadata for the specified type, or null if the context has no metadata for the type.