Skip to content

Conversation

@larryro
Copy link

@larryro larryro commented Feb 6, 2026

Summary

  • Add missing visibility filter to schemas generation in generateOpenApiSpec, matching the existing filter already applied to paths generation
  • Prevents bytes unsupported error when internal functions use v.bytes() in args or returns

Fixes #908

Test plan

  • Run npx convex-helpers open-api-spec on a project with an internalAction using v.bytes() in args — should generate successfully without error
  • Run with --include-internal flag — should include internal functions in both paths and schemas

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Summary by CodeRabbit

  • Bug Fixes

    • Schema generation now consistently hides internal/private functions unless explicitly enabled, keeping API specs aligned with visible endpoints.
  • Style

    • Widespread TypeScript formatting adjustments (generic/type declaration reflows and trailing commas) across helper packages; no behavioral or public API changes.

Internal functions were correctly filtered from the paths section but
not from the schemas section. This caused the command to fail with
"bytes unsupported" when internal functions use v.bytes() in args or
returns.

Fixes get-convex#908
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

Adds a visibility filter to OpenAPI schema generation so internal functions are excluded when includeInternal is false; plus widespread TypeScript formatting changes (multiline generic parameter reflows) across several helper modules. No public API signature changes.

Changes

Cohort / File(s) Summary
OpenAPI schema visibility fix
packages/convex-helpers/cli/openApiSpec.ts
Added missing visibility filter to schema generation to exclude internal functions when includeInternal is false, aligning schema filtering with endpoint path filtering and preventing processing of internal-only types.
Type formatting / generics reflow
packages/convex-helpers/react/sessions.ts, packages/convex-helpers/server/customFunctions.ts, packages/convex-helpers/server/filter.ts, packages/convex-helpers/server/rowLevelSecurity.ts, packages/convex-helpers/server/stream.ts, packages/convex-helpers/server/triggers.ts, packages/convex-helpers/server/zod3.ts, packages/convex-helpers/server/zod4.ts
Non-functional formatting changes: generic parameter lists and type declarations were reflowed to multiline forms and trailing commas added. No semantic or behavioral changes to exported APIs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • ianmacartney
  • Nicolapps

Poem

🐰 A tiny fix hopped into place,
Schemas now skip the hidden space.
Generics stretched out, tidy and neat,
Internal bytes no longer meet.
Hooray — the spec and rabbit dance, so fleet!

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Multiple out-of-scope changes detected: formatting changes to generic parameters in sessions.ts, customFunctions.ts, filter.ts, rowLevelSecurity.ts, stream.ts, triggers.ts, zod3.ts, and zod4.ts unrelated to the #908 issue. Remove all formatting-only changes to generic parameter lists. Retain only the openApiSpec.ts change that fixes the visibility filter for schemas generation.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: adding a visibility filter to exclude internal functions from schemas in the open-api-spec generation.
Linked Issues check ✅ Passed The PR directly addresses issue #908 by adding the missing visibility filter to schemas generation, matching the proposed fix that filters internal functions when includeInternal is false.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 6, 2026

Open in StackBlitz

npm i https://pkg.pr.new/get-convex/convex-helpers@909

commit: 4f7511a

@ianmacartney
Copy link
Member

Feel free to run the command with the pkg-pr-new package
And include the template message / fix tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

open-api-spec: Internal functions not filtered when generating schemas, causing 'bytes unsupported' error

2 participants