Definition
Assembly: CloudNimble.ClaudeEssentials.dll Namespace: CloudNimble.ClaudeEssentials.Hooks Inheritance: System.Text.Json.Serialization.JsonSerializerContextSyntax
Summary
Provides AOT-compatible JSON serialization context for Claude Code hook types. This context uses source generators to pre-compile serialization code, eliminating the need for runtime reflection.Usage
ClaudeHooksJsonContext is a source-generated JsonSerializerContext that enables AOT-compatible JSON serialization.
Direct Usage
Accessing Options
Extending for Custom Types
Create your own context for strongly-typed tool inputs:Remarks
For generic hook types (PreToolUseHookInput, PostToolUseHookInput, etc.), this context registers versions using Object as the type parameter. If you need strongly-typed serialization for specific tool inputs/outputs, create your own JsonSerializerContext with additional type registrations. Usage example:Constructors
.ctor
Syntax
.ctor
Syntax
Parameters
| Name | Type | Description |
|---|---|---|
options | System.Text.Json.JsonSerializerOptions | - |
Properties
Boolean
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<bool>
CompactTrigger
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.CompactTrigger>
Default
The default JsonSerializerContext associated with a default JsonSerializerOptions instance.Syntax
Property Value
Type:CloudNimble.ClaudeEssentials.Hooks.ClaudeHooksJsonContext
HookDecision
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.HookDecision>
HookEventName
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.HookEventName>
JsonElement
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<System.Text.Json.JsonElement>
NotificationHookInput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.NotificationHookInput>
NotificationHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.NotificationHookOutput>
NotificationType
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.NotificationType>
NullableHookDecision
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<System.Nullable<CloudNimble.ClaudeEssentials.Hooks.Enums.HookDecision>>
NullablePermissionDecision
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<System.Nullable<CloudNimble.ClaudeEssentials.Hooks.Enums.PermissionDecision>>
Object
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<object>
PermissionDecision
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.PermissionDecision>
PermissionMode
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.PermissionMode>
PermissionRequestBehavior
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.PermissionRequestBehavior>
PermissionRequestDecisionObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestDecision<object>>
PermissionRequestHookInputObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.PermissionRequestHookInput<object>>
PermissionRequestHookOutputObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestHookOutput<object>>
PermissionRequestSpecificOutputObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PermissionRequestSpecificOutput<object>>
PostToolUseHookInputObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.PostToolUseHookInput<object, object>>
PostToolUseHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseHookOutput>
PostToolUseSpecificOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PostToolUseSpecificOutput>
PreCompactHookInput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.PreCompactHookInput>
PreCompactHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PreCompactHookOutput>
PreToolUseHookInputObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.PreToolUseHookInput<object>>
PreToolUseHookOutputObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseHookOutput<object>>
PreToolUseSpecificOutputObject
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.PreToolUseSpecificOutput<object>>
SessionEndHookInput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionEndHookInput>
SessionEndHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionEndHookOutput>
SessionEndReason
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.SessionEndReason>
SessionStartHookInput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.SessionStartHookInput>
SessionStartHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartHookOutput>
SessionStartSource
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Enums.SessionStartSource>
SessionStartSpecificOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.SessionStartSpecificOutput>
StopHookInput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.StopHookInput>
StopHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.StopHookOutput>
String
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<string>
SubagentStopHookInput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.SubagentStopHookInput>
SubagentStopHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.SubagentStopHookOutput>
UserPromptSubmitHookInput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Inputs.UserPromptSubmitHookInput>
UserPromptSubmitHookOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitHookOutput>
UserPromptSubmitSpecificOutput
Defines the source generated JSON serialization contract metadata for a given type.Syntax
Property Value
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo<CloudNimble.ClaudeEssentials.Hooks.Outputs.UserPromptSubmitSpecificOutput>
Methods
GetTypeInfo Override
Syntax
Parameters
| Name | Type | Description |
|---|---|---|
type | System.Type | - |
Returns
Type:System.Text.Json.Serialization.Metadata.JsonTypeInfo?
Related APIs
- System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver