Hook output schemas reject explicit null for optional fields serde accepts
What happened?
Some generated hook output schemas set optional fields to default: null but do not include null as an allowed type.
For example, session-start.command.output.schema.json has optional fields such as reason, systemMessage, and hookSpecificOutput with default: null, but their schemas do not allow explicit null values.
The parser uses serde Option fields through serde_json::from_value, so explicit null is accepted by the parser for those optional fields. The schema is stricter than the implementation.
Expected behavior
Generated hook output schemas should either allow null for optional fields that serde accepts, or avoid advertising default: null when explicit null is not intended to validate.
Additional context
I searched open issues and PRs for terms including hook output schema, optional fields, null, reason, systemMessage, and hookSpecificOutput, and did not find an existing open item that appears to cover this schema/parser mismatch.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗