fix(sdk): preserve primitive JSON Schema semantics - #4316
fix(sdk): preserve primitive JSON Schema semantics#4316Alberto Schiabel (jkomyno) wants to merge 28 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The Please review and fix the vulnerabilities. You can try running: pnpm audit --fix --prodAudit output |
0fa770c to
370cf6a
Compare
370cf6a to
ed7b75f
Compare
ed7b75f to
e8233d6
Compare
Preview this PR's installerThe hermetic install E2E suite passed for this commit. These commands run the PR's installer scripts against the latest published CLI release — they preview installer behavior, not unreleased binaries. curl -fsSL "https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install.sh" | sh
curl -fsSL "https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install.sh" | COMPOSIO_INSTALL_SHELL=none shThe first command is the default flow: it installs the CLI and configures your shell automatically. The second installs only, without touching shell startup files. Shell-specific setup routes (the override points the variant at this PR's base installer): curl -fsSL "https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install/bash.sh" | COMPOSIO_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install.sh" sh
curl -fsSL "https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install/zsh.sh" | COMPOSIO_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install.sh" sh
curl -fsSL "https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install/fish.sh" | COMPOSIO_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/ComposioHQ/composio/f354f6f51b7bda8b3701a04f5bd9b7b3ef49eca2/install.sh" sh |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Thanks for consolidating these — I went through the diff and it covers every shape my closed PRs (#4301/#4302/#4303/#4307) reported: draft-06 type-array folding, draft-04 tuple |
…eep literal checks - thread the document root through Refs so shape properties and nested refs resolve #/$defs pointers - widen only the permissive node so enclosing defaults survive - dispatch enum/const before object and array parsers - materialize closed allOf branches open and re-apply strictness once - normalize draft-4 boolean bounds before whole-schema validation
- refuse non-local $ref at conversion time and build the validator with a local-only registry so remote references never trigger network I/O - match pattern through pydantic's linear-time regex, falling back to re only for ECMA-only constructs, so backtracking patterns cannot stall argument validation - run every anyOf/oneOf through exact validation so unions stop coercing booleans into integers - apply the omitted-additionalProperties strictness rule once per allOf over the union of closed branch keys
handle_response now reuses the normalize, validate, serialize, and alias restoration sequence of the wrapped callable instead of executing raw arguments.
…t draft 4 - skip the boolean-to-numeric bound rewrite when the caller selects draft 4 - open closed allOf object branches and apply strictness once over the union of declared keys, matching the Zod and Python converters - add the shared corpus case that pins the merged allOf contract
…pers - descend through Annotated exact-validation wrappers when marking explicit default fields, so array items with union properties keep their materialized defaults - wrap library models produced for top-level anyOf/oneOf so sibling assertions such as required are not dropped - keep exact validation on property-less param schemas instead of returning a bare dict
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 488ff1a. Configure here.
…tation Wrapping a bare dict forced object coercion on schemas that admit other JSON types. Delegating to json_schema_to_pydantic_type keeps exact validation and permissive materialization identical across entry points.

Summary
Review follow-up (second push)
json_schema_to_pydantic_type,json_schema_to_model,pydantic_model_from_param_schema), so they can no longer disagreeexclusiveMinimum/exclusiveMaximum(OpenAPI 3.0 style) no longer crash conversion — exact validation falls back to Draft 4, and the library input is translated to the numeric spellingreTypeErroron valid input — constraints are scoped per member before the library sees theminteger,constintersectsenum, annotation-only schemas accept anything, and an optional property with an emptyenumtolerates absencemultipleOfuses decimal scaling in all three converters (declareddivergesFromJsonSchemaon the corpus case)jsonschemain Python, fast-check + Ajv in TypeScript)Verification
make chk(ruff + mypy)@composio/json-schema-to-zod: 187 passed incl. 300-run fast-check property test; typecheck + build@composio/json-schema-to-effect-schema: 133 passed; typecheck@composio/corecorpus ingress tests: 61 passedgit diff --checkContributor context
This replaces four narrow proposals after independent local reproduction: