You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Official Google JSON Schema implementation for Go, providing schema inference from Go structs, schema construction, and validation. Supports JSON Schema draft 2020-12 and draft-07.
Status: Actively developed (last update 11 days ago)
Current Usage in gh-aw
This project uses google/jsonschema-go specifically for MCP tool schema generation - converting Go struct types into JSON schemas that describe MCP tool outputs.
Files & Integration
Files: 3 files (mcp_schema.go + 2 test files)
Test Coverage: 679 lines of comprehensive tests
Key APIs Used:
jsonschema.For[T]() - Schema inference from generics
Schema.Resolve() - Resolve schema references
Schema.Validate() - Validate JSON against schemas
Usage Pattern
// Generate schema from Go struct for MCP tool outputsfuncGenerateOutputSchema[Tany]() (*jsonschema.Schema, error) {
return jsonschema.For[T](nil)
}
// Add default values for better UX (SEP-1024 elicitation defaults)funcAddSchemaDefault(schema*jsonschema.Schema, propertyNamestring, valueany) error {
// ... manually adds Default field to properties
}
Research Findings
🆕 Recent Updates
v0.4.2 (December 19, 2025) - Latest
🐛 Bug fix: Empty map in Schema.Properties now serializes correctly
v0.4.0 (December 17, 2025) - Major Release
✨ Draft 07 Support - Added JSON Schema draft-07 compatibility
✨ PropertyOrder Feature - Maintains deterministic field ordering
🐛 Range limits for inferred integer types
🐛 Arrays now always accept null values
🐛 Value receiver for Schema.MarshalJSON (performance improvement)
v0.3.0 (September 2025) - Breaking Changes
⚠️ TypeSchemas key changed from any to reflect.Type
Action: Watch for resolution if validation errors become problematic
Recommendations
✅ Priority 1: Update Module (5 min)
Update to v0.4.2 - Simple, low-risk patch update for bug fix
go get github.com/google/jsonschema-go@v0.4.2
go mod tidy
📝 Priority 2: Documentation (20 min)
Document jsonschema tag usage - Help contributors understand schema generation
Add to mcp_schema.go:
// Schema Generation Tag Guide:// - json:"name" - JSON property name// - jsonschema:"desc" - Property description for LLMs// - omitempty - Mark field as optional// - Pointer types - Include null in type array
🎯 Priority 3: Feature Enhancement (15 min)
Add $schema field - Improve schema clarity for MCP clients
👀 Priority 4: Monitoring
Watch repository - The project is very active with regular releases. Monitor for:
New features that could benefit gh-aw
Bug fixes and performance improvements
Breaking changes in future major versions
Next Steps
✅ Immediate: Update to v0.4.2
📝 This week: Add schema tag documentation
🧪 Next sprint: Consider adding $schema field
👀 Ongoing: Monitor repository for relevant updates
Conclusion
The use of google/jsonschema-go in this project is well-implemented and appropriate. The module is:
✅ Used for the right purpose (schema inference)
✅ Well-tested with comprehensive test coverage
✅ Part of a smart dual-library architecture
✅ Actively maintained by Google
⚠️ Slightly behind (2 patch versions)
Rating: ⭐⭐⭐⭐ (4/5) - Very good implementation with minor version lag
The main action items are straightforward: update to the latest patch version and add some documentation. The architectural decision to use this for inference while using santhosh-tekuri/jsonschema for validation is exemplary.
Generated by Go Fan on 2025-12-30 Module summary saved to: specs/mods/google-jsonschema-go.md
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
🐹 Go Fan Report: google/jsonschema-go
Module Overview
Official Google JSON Schema implementation for Go, providing schema inference from Go structs, schema construction, and validation. Supports JSON Schema draft 2020-12 and draft-07.
Current Usage in gh-aw
This project uses
google/jsonschema-gospecifically for MCP tool schema generation - converting Go struct types into JSON schemas that describe MCP tool outputs.Files & Integration
jsonschema.For[T]()- Schema inference from genericsSchema.Resolve()- Resolve schema referencesSchema.Validate()- Validate JSON against schemasUsage Pattern
Research Findings
🆕 Recent Updates
v0.4.2 (December 19, 2025) - Latest
v0.4.0 (December 17, 2025) - Major Release
v0.3.0 (September 2025) - Breaking Changes
anytoreflect.Type📊 Version Status
🏗️ Architectural Discovery: Dual-Library Pattern
This project demonstrates an excellent architectural pattern by using TWO complementary JSON Schema libraries:
google/jsonschema-go - Schema INFERENCE
pkg/cli/mcp_schema.gosanthosh-tekuri/jsonschema/v6 - Schema VALIDATION
pkg/workflow/schema_validation.goThis is smart because:
santhosh-tekuriis mature (v6), battle-tested for validationgoogle/jsonschema-gois modern, Google-backed, perfect for inferenceImprovement Opportunities
🏃 Quick Wins
1. Update to v0.4.2 (5 minutes)
Priority: High - Simple version bump for bug fix
go get github.com/google/jsonschema-go@v0.4.2 && go mod tidy2. Add $schema Field to Generated Schemas (15 minutes)
Priority: Medium - Improves schema clarity
$schema: "https://json-schema.org/draft/2020-12/schema"to generated schemas✨ Feature Opportunities
3. Leverage PropertyOrder Feature (10 minutes)
Priority: Low - Quality of life improvement
4. Validate Schemas Against Real MCP Output (30 minutes)
Priority: Medium - End-to-end validation
TestGeneratedSchemasValidateRealOutput📐 Best Practice Alignment
5. Document Schema Tag Conventions (20 minutes)
Priority: Medium - Developer experience
json,jsonschema) used but not documentedmcp_schema.goor create separate guide6. Investigate Custom Type Support (30 minutes)
Priority: Low - Depends on need
ForOptions.TypeSchemasfor one-off overrides if needed🔧 General Improvements
7. Monitor Open Issues (Ongoing awareness)
Issue Weekly Research Report - August 13, 2025: Agentic Workflows Market Analysis #46: Self-referential structures not supported
Issue #37: Global TypeSchemas registry
Issues the compute-text step should only be lazily inserted #20, Concurrent download of 10 logs at a time #53: Better error reporting
Recommendations
✅ Priority 1: Update Module (5 min)
Update to v0.4.2 - Simple, low-risk patch update for bug fix
📝 Priority 2: Documentation (20 min)
Document jsonschema tag usage - Help contributors understand schema generation
Add to
mcp_schema.go:🎯 Priority 3: Feature Enhancement (15 min)
Add $schema field - Improve schema clarity for MCP clients
👀 Priority 4: Monitoring
Watch repository - The project is very active with regular releases. Monitor for:
Next Steps
Conclusion
The use of
google/jsonschema-goin this project is well-implemented and appropriate. The module is:Rating: ⭐⭐⭐⭐ (4/5) - Very good implementation with minor version lag
The main action items are straightforward: update to the latest patch version and add some documentation. The architectural decision to use this for inference while using
santhosh-tekuri/jsonschemafor validation is exemplary.Generated by Go Fan on 2025-12-30
Module summary saved to: specs/mods/google-jsonschema-go.md
All reactions