[go-fan] Go Module Review: google/jsonschema-go #6818
Closed
Replies: 2 comments 1 reply
-
|
/plan |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
This discussion was automatically closed because it was created by an agentic workflow more than 3 days ago. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🐹 Go Fan Report: google/jsonschema-go
🎯 Perfect Timing: v0.4.0 Released Yesterday!
Today's review analyzes github.com/google/jsonschema-go - and we caught it at the perfect moment! Version v0.4.0 was released yesterday (December 17, 2025) with significant new features and bug fixes.
Module Overview
google/jsonschema-go is Google's official JSON Schema implementation for Go, maintained by the core Go team. It provides schema inference from Go types, validation against JSON Schema specifications (draft 2020-12 and draft-07), and zero-dependency operation using only the Go standard library.
Key Characteristics:
@jba,@samthanawalla,@findleyr)Current Usage in gh-aw
Minimal but Strategic:
pkg/cli/mcp_schema.go)Implementation:
Test Coverage:
LogsData,AuditData,WorkflowStatustypes🚀 What's NEW in v0.4.0 (Released Yesterday!)
PropertyOrder Feature (#51)
PERFECT for gh-aw! Schemas now include
PropertyOrderfield for deterministic property ordering. This aligns perfectly with gh-aw's workflow YAML generation needs where field order matters.Full Draft-07 Support (#50)
dependenciesfield handlingidandanchorbehavior$refobjectsCritical Bug Fixes
Nullable Types for Slices (#49)
Slices now correctly include
nulltype alongside array type:{"type": ["null", "array"], "items": {"type": "string"}}Nullable Types for Non-Native Pointers (#42)
Fixed handling of
*time.Timeand similar pointer types to properly include null.JSON Marshal Consistency (#52)
Fixed marshaling bugs by using value receiver for
Schema.MarshalJSON().Other Fixes
ai-inferenceandgenaiscriptfrom CLI #30)Research Findings
API Design (Excellent)
Preferred Pattern:
With Custom Types:
Struct Tags:
Validation Pattern
Comparison with santhosh-tekuri/jsonschema/v6
gh-aw uses both JSON schema libraries:
Different use cases, complementary tools:
No conflict - they serve different purposes!
Improvement Opportunities
🏃 Quick Wins (Implement This Week)
1. UPGRADE to v0.4.0 (URGENT)
Effort: 5 minutes | Impact: HIGH | Risk: VERY LOW
Why now:
2. Simplify GenerateOutputSchema
Effort: 2 minutes | Impact: LOW | Risk: NONE
Current implementation:
Recommended (more idiomatic):
Benefits:
3. Add Schema Validation Test
Effort: 15 minutes | Impact: MEDIUM | Risk: NONE
Ensure generated schemas validate actual output:
✨ Feature Opportunities (Future)
4. Add Custom Type Schemas for Domain Types
Effort: 30 minutes | Priority: MEDIUM
If gh-aw adds custom types like UUID or cron expressions:
5. Use Schemas in Production MCP Tools
Effort: 2 hours | Priority: MEDIUM
Currently schemas are generated but not used. Consider:
6. Monitor Upstream Issues
Watch these:
gh aw helpand notice #47: Extended jsonschema tag support (minLength, pattern, etc.)Consider contributing:
True()andFalse()helper functions📐 Best Practice Alignment
7. Add Comprehensive Documentation
Add documentation explaining schema generation rules and MCP requirements:
Recommendations
Immediate (This Week)
For[T]()directlyNear-Term (Next Month)
Long-Term (Future)
gh aw helpand notice #47 for extended tag supportRating: ⭐⭐⭐⭐⭐ (5/5)
Why Excellent:
For[T]()functionNext Steps
Generated by Go Fan 🐹
Module summary saved to: specs/mods/jsonschema-go.md
Review date: December 18, 2025
Beta Was this translation helpful? Give feedback.
All reactions