go-sdk/jsonschema
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Albert Sundjaja bfb9215d16
jsonchema: support additional keywords
Support additional (extra) keywords beyond those specified in the
`Schema` type. The current behavior is additional keywords are dropped.

To follow up:

- There are similar util functions in `mcp/util.go` which don't seem to
be used. Maybe we should move it to `internal/util` instead of
`jsonchema/util.go` package?
- The method `[Un]MarshalJSON` is only on `pointer receiver`, is this
intended? (that means it will only work if we [un]marshal pointer to the
`Schema` instance)
- The fix is using the [un]marshalStructWithMap from `mcp/util.go` and
there are requirements for the function to work properly but these are
not strictly checked e.g. need `json:"-"` tag for the Extra field.

Fixes #69.
2025-07-01 07:02:26 -04:00
..
meta-schemas/draft2020-12 jsonschema: resolve remote references 2025-05-13 11:46:13 -07:00
testdata jsonschema: add more schema fields 2025-05-21 17:03:52 -07:00
annotations.go internal/mcp: move jsonschema out of mcp/internal 2025-05-05 13:17:44 -07:00
doc.go jsonschema: unexport ForType (#71) 2025-06-30 14:44:40 -04:00
infer.go jsonschema: unexport ForType (#71) 2025-06-30 14:44:40 -04:00
infer_test.go internal/mcp: validate tool input schemas 2025-06-04 07:51:59 -07:00
json_pointer.go internal/mcp/internal/util: add Wrapf 2025-06-09 08:52:39 -07:00
json_pointer_test.go jsonschema: implement JSON Pointers for schemas 2025-05-07 09:31:46 -07:00
resolve.go internal/mcp: validate tool input schemas 2025-06-04 07:51:59 -07:00
resolve_test.go internal/mcp/jsonschema: validate defaults 2025-05-28 07:50:15 -07:00
schema.go jsonchema: support additional keywords 2025-07-01 07:02:26 -04:00
schema_test.go jsonchema: support additional keywords 2025-07-01 07:02:26 -04:00
util.go jsonchema: support additional keywords 2025-07-01 07:02:26 -04:00
util_test.go jsonchema: support additional keywords 2025-07-01 07:02:26 -04:00
validate.go internal/mcp/internal/util: add Wrapf 2025-06-09 08:52:39 -07:00
validate_test.go internal/mcp: unify json tag parsing 2025-06-04 11:03:21 -07:00