Skip to content

Preserve nullable refs and remove unused server-action imports - #83

Merged
owjs3901 merged 3 commits into
mainfrom
devfive/3099154426bffbeef8b62999b80bb038/fix-nullable-ref-and-disabled-server-actions
Nov 5, 2026
Merged

owjs3901 merged 3 commits into
mainfrom
devfive/3099154426bffbeef8b62999b80bb038/fix-nullable-ref-and-disabled-server-actions

Conversation

@devfive-relay-c70423

@devfive-relay-c70423 devfive-relay-c70423 Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

OpenAPI 3.1 nullable $ref properties lose null after union normalization, so valid requests such as serviceType: null fail with TS2322. Preserve nullability when resolving enum aliases, object component references, and inline references. Optional and required properties keep their existing requiredness, and non-nullable references remain strict.

Generated server-action modules also fail noUnusedLocals / noUnusedParameters checks when actions are disabled or no operation IDs exist. Emit empty modules in those cases, and import only the method scope types used by active actions. Apply the same import selection to generated declarations.

Added regression tests for nullable enum/object refs in request, response, and error contexts, plus generated consumers compiled with strict TypeScript checks. The integration fixtures accept valid enum values and null, reject invalid enum values and missing required fields, and verify that the HTTP request JSON preserves null. Includes patch changepacks for the affected generator, fetch, and utils workspaces.

Utility filesystem spies are restored after every test so the generated-client checks work regardless of test file order. Request method defaults, empty-document generation, and referenced enum context handling are also tested with CI's Bun 1.4.4. The 100% coverage requirement is unchanged.

Validation:

  • bun run lint — passed.
  • bun run build — all workspace packages passed.
  • bunx bun@1.4.4 test --coverage --coverage-reporter=lcov --coverage-reporter=text — 1,184 passed, 158 snapshots, 100% function and line coverage.
  • The original consumer reproduction now compiles without TS2322, TS6192, or TS6133.
  • Fifteen regression cases failed against the original implementation and pass with this change.

Submitted via Devfive hub.
Employee Git identity (self-declared): <>
Device: 3099154426bffbeef8b62999b80bb038

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Changepacks

@devup-api/fetch@0.1.25 → 0.1.26 - packages/fetch/package.json

Patch

  • Preserve nullable referenced enum and object types, omit unused imports from generated server actions, restore filesystem test spies, and verify request defaults and empty-schema generation with Bun 1.4.4 coverage

@devup-api/generator@0.1.27 → 0.1.28 - packages/generator/package.json

Patch

  • Preserve nullable referenced enum and object types, omit unused imports from generated server actions, restore filesystem test spies, and verify request defaults and empty-schema generation with Bun 1.4.4 coverage

@devup-api/hookform@0.1.9 → 0.1.10 - packages/hookform/package.json

Patch

  • Auto-update: depends on '@devup-api/fetch' via a local workspace dependency

@devup-api/next-plugin@0.1.16 → 0.1.17 - packages/next-plugin/package.json

Patch

  • Auto-update: depends on '@devup-api/generator' via a local workspace dependency

@devup-api/react-query@0.1.19 → 0.1.20 - packages/react-query/package.json

Patch

  • Auto-update: depends on '@devup-api/fetch' via a local workspace dependency

@devup-api/rsbuild-plugin@0.1.16 → 0.1.17 - packages/rsbuild-plugin/package.json

Patch

  • Auto-update: depends on '@devup-api/generator' via a local workspace dependency

@devup-api/ui@0.1.6 → 0.1.7 - packages/ui/package.json

Patch

  • Auto-update: depends on '@devup-api/hookform' via a local workspace dependency

@devup-api/utils@0.1.13 → 0.1.14 - packages/utils/package.json

Patch

  • Preserve nullable referenced enum and object types, omit unused imports from generated server actions, restore filesystem test spies, and verify request defaults and empty-schema generation with Bun 1.4.4 coverage

@devup-api/vite-plugin@0.1.16 → 0.1.17 - packages/vite-plugin/package.json

Patch

  • Auto-update: depends on '@devup-api/generator' via a local workspace dependency

@devup-api/webpack-plugin@0.1.16 → 0.1.17 - packages/webpack-plugin/package.json

Patch

  • Auto-update: depends on '@devup-api/generator' via a local workspace dependency

@devup-api/zod@0.1.7 → 0.1.8 - packages/zod/package.json

Patch

  • Auto-update: depends on '@devup-api/fetch' via a local workspace dependency

@owjs3901
owjs3901 marked this pull request as ready for review November 5, 2026 00:13
@owjs3901
owjs3901 merged commit d8dbe78 into main Nov 5, 2026
2 checks passed
@owjs3901
owjs3901 deleted the devfive/3099154426bffbeef8b62999b80bb038/fix-nullable-ref-and-disabled-server-actions branch November 5, 2026 00:14
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.

1 participant