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
optionsJsonSerializerOptionsThe 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
Default
The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
public static OpenApiSchemaSourceGenerationContext Default { get; }
Property Value
GeneratedSerializerOptions
The source-generated options associated with this context.
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }
Property Value
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
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
Methods
GetTypeInfo(Type)
Gets metadata for the specified type.
public override JsonTypeInfo? GetTypeInfo(Type type)
Parameters
typeTypeThe type to fetch metadata for.
Returns
- JsonTypeInfo
The metadata for the specified type, or null if the context has no metadata for the type.