Skip to content

fix(angular): send required nullable query params as empty string without a paramsSerializer - #3716

Merged
melloware merged 1 commit into
orval-labs:masterfrom
the-ult:fix/3712-angular-required-nullable-params
Jul 13, 2026
Merged

fix(angular): send required nullable query params as empty string without a paramsSerializer#3716
melloware merged 1 commit into
orval-labs:masterfrom
the-ult:fix/3712-angular-required-nullable-params

Conversation

@the-ult

@the-ult the-ult commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #3712.

For Angular HttpClient services and httpResource functions, a query parameter that is both required: true and nullable per the OpenAPI schema was silently dropped from the request whenever its runtime value was null — unless a custom paramsSerializer mutator was configured. The request then went out without a parameter the spec documents as required.

Root cause

preserveRequiredNullables was only ever passed as true in the paramsSerializer branches (packages/core/src/generators/options.ts and the httpResource builder). That gating exists for a real reason: Angular's params type (HttpParams | Record<string, string | number | boolean | ReadonlyArray<...>>) structurally excludes null, so a literal null is only type-safe when a serializer consumes it before it reaches Angular. The naive fix of passing true unconditionally does not compile (see the analysis in #3712).

Fix

  • The shared/emitted filterParams helper now emits filteredParams[key] = preserveRequiredNullables ? null : ''; for required-nullable null values: without a serializer, null is sent as an empty string (?key=) so the key still reaches the wire; with a serializer, the literal null is preserved for the serializer to encode (unchanged behavior).
  • The inline IIFE generator now emits the requiredNullableParamKeys Set + its reading branch whenever required-nullable keys exist (previously only when a serializer was configured), while preserving the TS6133: 'requiredNullableParamKeys' is declared but its value is never read. #3593 guarantee that the Set is only declared when the branch reading it is emitted (no TS6133).
  • The '' assignment fits the existing non-nullable overload of filterParams, so the four overloads and filteredParamValueType are unchanged — no type widening.

Tests

  • 3 new unit tests in packages/core/src/generators/options.test.ts (empty-string fallback on the IIFE path, branch omission when no required-nullable keys, shared-helper body).
  • New fixture spec tests/specifications/issue-3712.yaml + three tests/configs/angular.config.ts entries (issue3712, issue3712HttpResource, issue3712Serializer, modeled on the issue-3326 pattern) with tests/api-generation.spec.ts assertions for all three variants.
  • New runtime proof: samples/angular-app/src/app/required-nullable-params.spec.ts uses HttpTestingController against the generated no-serializer PetsService and asserts req.params.get('requirednullableString') === '' — i.e. the key actually reaches the wire.
  • All affected snapshots/samples regenerated (tests/__snapshots__/angular/**, angular-query/**, default/issue-2998, samples/angular-app, samples/angular-query) — every diff is the same expected helper-body hunk.

Docs

docs/content/docs/guides/angular.mdx "Query parameter filtering": documents the empty-string fallback, notes that override.paramsFilter replaces this fallback (escape hatch back to drop-silently semantics), and the reference default-filter-behaviour.ts snippet now mirrors the emitted ternary exactly.

Backwards compatibility

  • Serializer path: unchanged (literal null still preserved).
  • No new config surface. Users who want the old dropping behavior can use override.paramsFilter.
  • Behavior change is scoped to a case that previously violated the OpenAPI contract (required param missing from the request).

Validation

bun run build:release ✅ · bun run lint ✅ · core 2105/2105, angular 222/222, query 140/140 ✅ · snapshots 5313 tests, update + verify both green ✅ · angular-app ng test 17/17 incl. the new wire-level spec ✅ (one pre-existing macOS-only /tmp realpath flake in packages/orval options.test.ts, unrelated — package untouched).

Related issues

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Required+nullable Angular query parameters are now retained when explicitly set to null.
    • When no custom paramsSerializer is used, null is sent as an empty value (?key=); when a serializer is configured, the literal null is preserved.
    • Consistent behavior across generated clients, HTTP resources, and request modes.
  • Documentation
    • Updated Angular docs to clarify the required + nullable null handling and how filtering overrides affect it.
  • Tests
    • Added/updated coverage for request serialization and generated outputs for the relevant scenarios.

Copilot AI review requested due to automatic review settings July 11, 2026 12:51
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 813cb933-91a9-4dce-8e7d-433eccd6eb3b

📥 Commits

Reviewing files that changed from the base of the PR and between aef12c0 and e3164ee.

⛔ Files ignored due to path filters (11)
  • samples/angular-app/__snapshots__/api/endpoints-zod/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-both/pets/pets.resource.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-both/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-client-custom-params/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-client/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-resource-zod/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-resource/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints-custom-instance/pets/pets.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints-no-transformer/pets/pets.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints-zod/pets/pets.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints/pets/pets.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (15)
  • docs/content/docs/guides/angular.mdx
  • packages/core/src/generators/options.test.ts
  • packages/core/src/generators/options.ts
  • samples/angular-app/src/api/endpoints-zod/pets/pets.service.ts
  • samples/angular-app/src/api/http-both/pets/pets.resource.ts
  • samples/angular-app/src/api/http-both/pets/pets.service.ts
  • samples/angular-app/src/api/http-client-custom-params/pets/pets.service.ts
  • samples/angular-app/src/api/http-client/pets/pets.service.ts
  • samples/angular-app/src/api/http-resource-zod/pets/pets.service.ts
  • samples/angular-app/src/api/http-resource/pets/pets.service.ts
  • samples/angular-app/src/app/required-nullable-params.spec.ts
  • samples/angular-query/src/api/endpoints-custom-instance/pets/pets.ts
  • samples/angular-query/src/api/endpoints-no-transformer/pets/pets.ts
  • samples/angular-query/src/api/endpoints-zod/pets/pets.ts
  • samples/angular-query/src/api/endpoints/pets/pets.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • samples/angular-query/src/api/endpoints-no-transformer/pets/pets.ts
  • samples/angular-app/src/app/required-nullable-params.spec.ts
  • samples/angular-app/src/api/endpoints-zod/pets/pets.service.ts
  • samples/angular-app/src/api/http-both/pets/pets.resource.ts
  • samples/angular-app/src/api/http-resource-zod/pets/pets.service.ts
  • samples/angular-app/src/api/http-client/pets/pets.service.ts
  • samples/angular-app/src/api/http-client-custom-params/pets/pets.service.ts
  • samples/angular-query/src/api/endpoints-zod/pets/pets.ts
  • samples/angular-app/src/api/http-both/pets/pets.service.ts
  • samples/angular-query/src/api/endpoints-custom-instance/pets/pets.ts
  • packages/core/src/generators/options.ts
  • samples/angular-query/src/api/endpoints/pets/pets.ts

📝 Walkthrough

Walkthrough

Angular query filtering now keeps required-nullable parameters on the wire as empty strings without a serializer and preserves literal null when a serializer is configured. Generator logic, generated samples, tests, fixtures, and documentation were updated.

Changes

Angular required-nullable query parameters

Layer / File(s) Summary
Generation fixtures and configurations
tests/specifications/issue-3712.yaml, tests/configs/angular.config.ts
Adds issue-specific OpenAPI input and Angular generation targets for standard, httpResource, and custom serializer scenarios.
Angular generator filtering logic
packages/core/src/generators/options.ts, packages/core/src/generators/options.test.ts
Generates required-nullable handling that emits '' without a serializer and preserves null when preserveRequiredNullables is enabled.
Generated client behavior and runtime coverage
samples/angular-app/..., samples/angular-query/..., tests/api-generation.spec.ts, samples/angular-app/src/app/required-nullable-params.spec.ts
Updates generated filtering branches and verifies generated output plus request serialization of required-nullable null values.
Angular filtering documentation
docs/content/docs/guides/angular.mdx
Documents default behavior, serializer handling, and paramsFilter override semantics.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OpenAPI
  participant AngularGenerator
  participant filterParams
  participant HttpClient
  OpenAPI->>AngularGenerator: Define required nullable query parameter
  AngularGenerator->>filterParams: Generate requiredNullableKeys logic
  filterParams->>HttpClient: Send empty string without serializer
  filterParams->>HttpClient: Preserve null with serializer
Loading

Possibly related issues

  • orval-labs/orval#3712 — Directly tracks the required-nullable Angular query parameter serialization fix.

Possibly related PRs

Suggested labels: angular

Suggested reviewers: snebjorn, daugvinasr, github-actions[bot], gogolian, melloware

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main Angular fix: required nullable query params are sent as empty strings when no paramsSerializer is used.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Angular client query parameter filtering so required + nullable query params are no longer silently omitted when their runtime value is null and no paramsSerializer is configured. Instead, the generated filter logic emits '' (wire form ?key=) to keep the required key present, while preserving existing behavior (literal null) when a serializer is configured.

Changes:

  • Updated generated Angular filterParams logic to emit preserveRequiredNullables ? null : '' for required-nullable null values.
  • Adjusted the inline IIFE param-filter generation to emit requiredNullableParamKeys / branch whenever required-nullable keys exist (not only with serializers), while avoiding TS6133 unused-variable cases.
  • Added unit, generation, and Angular runtime tests + fixtures; regenerated affected snapshots/samples; updated Angular docs to document the new behavior and the paramsFilter escape hatch.

Reviewed changes

Copilot reviewed 62 out of 62 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/specifications/issue-3712.yaml New minimal spec fixture for required+nullable query params.
tests/configs/angular.config.ts Adds generation configs for issue-3712 variants (plain, httpResource, serializer).
tests/api-generation.spec.ts Adds assertions verifying empty-string fallback and serializer preservation.
packages/core/src/generators/options.ts Implements empty-string fallback + required-nullable branch emission logic.
packages/core/src/generators/options.test.ts Adds unit coverage for IIFE/helper behavior and branch omission.
docs/content/docs/guides/angular.mdx Documents required-nullable empty-string fallback + paramsFilter implications.
samples/angular-app/src/app/required-nullable-params.spec.ts Adds wire-level Angular test asserting ?key= behavior via HttpTestingController.
tests/snapshots/default/issue-2998/requests/requests.service.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/zod-schema-response/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/url-encode-parameters/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/url-encode-parameters-http-resource/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/tags/pets.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/tags-split/pets/pets.service.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/split/endpoints.service.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/petstore/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/named-parameters/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/multi-content-query-params/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/issue-3712/model/listThingsParams.ts New snapshot models for issue-3712 fixture.
tests/snapshots/angular/issue-3712/model/index.ts New snapshot barrel for issue-3712 fixture models.
tests/snapshots/angular/issue-3712/endpoints.ts New snapshot output verifying empty-string fallback without serializer.
tests/snapshots/angular/issue-3712-serializer/model/listThingsParams.ts New snapshot models for issue-3712 serializer variant.
tests/snapshots/angular/issue-3712-serializer/model/index.ts New snapshot barrel for issue-3712 serializer variant models.
tests/snapshots/angular/issue-3712-serializer/endpoints.ts New snapshot output verifying literal null preserved when serializer configured.
tests/snapshots/angular/issue-3712-http-resource/model/listThingsParams.ts New snapshot models for issue-3712 httpResource variant.
tests/snapshots/angular/issue-3712-http-resource/model/index.ts New snapshot barrel for issue-3712 httpResource variant models.
tests/snapshots/angular/issue-3712-http-resource/endpoints.ts New snapshot output verifying empty-string fallback in httpResource path.
tests/snapshots/angular/issue-3634/widget/widget.service.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/issue-3634/ab-widget/ab-widget.service.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/issue-3624/petstore.client.service.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/issue-3326/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/issue-3326-serializer/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/issue-3103/default/default.service.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/http-resource-zod/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/http-resource-zod-disabled/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular/http-resource-tags/pets.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular-query/use-prefetch/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular-query/url-encode-parameters/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular-query/tags-split/pets/pets.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular-query/split/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
tests/snapshots/angular-query/basic/endpoints.ts Snapshot update for new filterParams required-nullable behavior.
samples/angular-query/src/api/endpoints/pets/pets.ts Regenerated sample output with updated filterParams behavior.
samples/angular-query/src/api/endpoints-zod/pets/pets.ts Regenerated sample output with updated filterParams behavior.
samples/angular-query/src/api/endpoints-no-transformer/pets/pets.ts Regenerated sample output with updated filterParams behavior.
samples/angular-query/src/api/endpoints-custom-instance/pets/pets.ts Regenerated sample output with updated filterParams behavior + IIFE branch emission.
samples/angular-query/snapshots/api/endpoints/pets/pets.ts Snapshot update for regenerated sample output.
samples/angular-query/snapshots/api/endpoints-zod/pets/pets.ts Snapshot update for regenerated sample output.
samples/angular-query/snapshots/api/endpoints-no-transformer/pets/pets.ts Snapshot update for regenerated sample output.
samples/angular-query/snapshots/api/endpoints-custom-instance/pets/pets.ts Snapshot update for regenerated sample output + IIFE branch emission.
samples/angular-app/src/api/http-resource/pets/pets.service.ts Regenerated sample output with updated filterParams behavior.
samples/angular-app/src/api/http-resource-zod/pets/pets.service.ts Regenerated sample output with updated filterParams behavior.
samples/angular-app/src/api/http-client/pets/pets.service.ts Regenerated sample output with updated filterParams behavior.
samples/angular-app/src/api/http-client-custom-params/pets/pets.service.ts Regenerated sample output with updated filterParams behavior.
samples/angular-app/src/api/http-both/pets/pets.service.ts Regenerated sample output with updated filterParams behavior.
samples/angular-app/src/api/http-both/pets/pets.resource.ts Regenerated sample output with updated filterParams behavior.
samples/angular-app/src/api/endpoints-zod/pets/pets.service.ts Regenerated sample output with updated filterParams behavior.
samples/angular-app/snapshots/api/http-resource/pets/pets.service.ts Snapshot update for regenerated Angular app sample.
samples/angular-app/snapshots/api/http-resource-zod/pets/pets.service.ts Snapshot update for regenerated Angular app sample.
samples/angular-app/snapshots/api/http-client/pets/pets.service.ts Snapshot update for regenerated Angular app sample.
samples/angular-app/snapshots/api/http-client-custom-params/pets/pets.service.ts Snapshot update for regenerated Angular app sample.
samples/angular-app/snapshots/api/http-both/pets/pets.service.ts Snapshot update for regenerated Angular app sample.
samples/angular-app/snapshots/api/http-both/pets/pets.resource.ts Snapshot update for regenerated Angular app sample.
samples/angular-app/snapshots/api/endpoints-zod/pets/pets.service.ts Snapshot update for regenerated Angular app sample.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/core/src/generators/options.ts (1)

59-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider simplifying emitRequiredNullableBranch to avoid dead code.

When preserveRequiredNullables is true (serializer configured) but requiredNullableParamKeys is empty, the current condition still emits the Set declaration and the else if branch. The branch never matches (empty Set), so this is dead code in the generated output. Since preserveRequiredNullables only controls what value is assigned (null vs ''), not whether the branch should exist, the condition can be simplified to just requiredNullableParamKeys.length > 0 without changing behavior.

♻️ Proposed simplification
   const emitRequiredNullableBranch =
-    preserveRequiredNullables || requiredNullableParamKeys.length > 0;
+    requiredNullableParamKeys.length > 0;

This eliminates dead code in the common case where a paramsSerializer is configured but the spec has no required+nullable query params.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/generators/options.ts` around lines 59 - 60, Update
emitRequiredNullableBranch in the generator options logic to depend only on
requiredNullableParamKeys.length > 0. Preserve preserveRequiredNullables for
selecting the assigned value within the emitted branch, but avoid generating the
Set declaration and else-if branch when the key collection is empty.
samples/angular-app/src/app/required-nullable-params.spec.ts (1)

31-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a serializer-path test for completeness.

The test correctly validates the no-serializer empty-string behavior. Adding a parallel test using the http-client-custom-params service (where preserveRequiredNullables=true) would verify that null is preserved on the wire when a serializer is configured, completing the coverage for both code paths.

Based on learnings, files under samples/ are treated as sample/demo data, so this is an optional suggestion only.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@samples/angular-app/src/app/required-nullable-params.spec.ts` around lines 31
- 47, Add a parallel spec covering the serializer path through the
http-client-custom-params service with preserveRequiredNullables=true. Pass a
required nullable parameter as null, issue the request, and assert that the
serialized request preserves null on the wire while the existing non-null
parameter remains unchanged.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/core/src/generators/options.ts`:
- Around line 59-60: Update emitRequiredNullableBranch in the generator options
logic to depend only on requiredNullableParamKeys.length > 0. Preserve
preserveRequiredNullables for selecting the assigned value within the emitted
branch, but avoid generating the Set declaration and else-if branch when the key
collection is empty.

In `@samples/angular-app/src/app/required-nullable-params.spec.ts`:
- Around line 31-47: Add a parallel spec covering the serializer path through
the http-client-custom-params service with preserveRequiredNullables=true. Pass
a required nullable parameter as null, issue the request, and assert that the
serialized request preserves null on the wire while the existing non-null
parameter remains unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2b8ef410-ddd2-4c37-9ae7-db71a6da36aa

📥 Commits

Reviewing files that changed from the base of the PR and between c082bb4 and aef12c0.

⛔ Files ignored due to path filters (44)
  • samples/angular-app/__snapshots__/api/endpoints-zod/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-both/pets/pets.resource.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-both/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-client-custom-params/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-client/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-resource-zod/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-app/__snapshots__/api/http-resource/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints-custom-instance/pets/pets.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints-no-transformer/pets/pets.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints-zod/pets/pets.ts is excluded by !**/__snapshots__/**
  • samples/angular-query/__snapshots__/api/endpoints/pets/pets.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular-query/basic/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular-query/split/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular-query/tags-split/pets/pets.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular-query/url-encode-parameters/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular-query/use-prefetch/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/http-resource-tags/pets.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/http-resource-zod-disabled/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/http-resource-zod/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3103/default/default.service.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3326-serializer/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3326/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3624/petstore.client.service.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3634/ab-widget/ab-widget.service.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3634/widget/widget.service.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712-http-resource/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712-http-resource/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712-http-resource/model/listThingsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712-serializer/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712-serializer/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712-serializer/model/listThingsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712/model/index.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/issue-3712/model/listThingsParams.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/multi-content-query-params/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/named-parameters/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/petstore/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/split/endpoints.service.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/tags-split/pets/pets.service.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/tags/pets.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/url-encode-parameters-http-resource/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/url-encode-parameters/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/angular/zod-schema-response/endpoints.ts is excluded by !**/__snapshots__/**
  • tests/__snapshots__/default/issue-2998/requests/requests.service.ts is excluded by !**/__snapshots__/**
📒 Files selected for processing (18)
  • docs/content/docs/guides/angular.mdx
  • packages/core/src/generators/options.test.ts
  • packages/core/src/generators/options.ts
  • samples/angular-app/src/api/endpoints-zod/pets/pets.service.ts
  • samples/angular-app/src/api/http-both/pets/pets.resource.ts
  • samples/angular-app/src/api/http-both/pets/pets.service.ts
  • samples/angular-app/src/api/http-client-custom-params/pets/pets.service.ts
  • samples/angular-app/src/api/http-client/pets/pets.service.ts
  • samples/angular-app/src/api/http-resource-zod/pets/pets.service.ts
  • samples/angular-app/src/api/http-resource/pets/pets.service.ts
  • samples/angular-app/src/app/required-nullable-params.spec.ts
  • samples/angular-query/src/api/endpoints-custom-instance/pets/pets.ts
  • samples/angular-query/src/api/endpoints-no-transformer/pets/pets.ts
  • samples/angular-query/src/api/endpoints-zod/pets/pets.ts
  • samples/angular-query/src/api/endpoints/pets/pets.ts
  • tests/api-generation.spec.ts
  • tests/configs/angular.config.ts
  • tests/specifications/issue-3712.yaml

@pkg-pr-new

pkg-pr-new Bot commented Jul 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@orval/angular

bun add https://pkg.pr.new/@orval/angular@e3164ee

@orval/axios

bun add https://pkg.pr.new/@orval/axios@e3164ee

@orval/core

bun add https://pkg.pr.new/@orval/core@e3164ee

@orval/effect

bun add https://pkg.pr.new/@orval/effect@e3164ee

@orval/fetch

bun add https://pkg.pr.new/@orval/fetch@e3164ee

@orval/hono

bun add https://pkg.pr.new/@orval/hono@e3164ee

@orval/mcp

bun add https://pkg.pr.new/@orval/mcp@e3164ee

@orval/mock

bun add https://pkg.pr.new/@orval/mock@e3164ee

orval

bun add https://pkg.pr.new/orval@e3164ee

@orval/query

bun add https://pkg.pr.new/@orval/query@e3164ee

@orval/solid-start

bun add https://pkg.pr.new/@orval/solid-start@e3164ee

@orval/swr

bun add https://pkg.pr.new/@orval/swr@e3164ee

@orval/zod

bun add https://pkg.pr.new/@orval/zod@e3164ee

commit: e3164ee

@melloware melloware added the angular Related to Angular generation issues label Jul 12, 2026
melloware
melloware previously approved these changes Jul 12, 2026
@melloware

Copy link
Copy Markdown
Collaborator

Merge Conflicts here too

…hout a paramsSerializer

A query parameter that is required and nullable per the OpenAPI schema was
silently dropped from the request when its runtime value was null, unless a
paramsSerializer mutator was configured. Angular's HttpParams type structurally
excludes null, so the no-serializer path now serializes null as an empty
string ('' -> "key=") instead of dropping the key, keeping the request
contract-complete. The serializer path still preserves literal null for the
serializer to encode (unchanged).

Also fixes the inline IIFE generator to emit the requiredNullableParamKeys Set
and its reading branch whenever required-nullable keys exist, not only when a
serializer is configured, while preserving the orval-labs#3593 TS6133 guarantee.

Fixes orval-labs#3712

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@the-ult
the-ult force-pushed the fix/3712-angular-required-nullable-params branch from aef12c0 to e3164ee Compare July 13, 2026 21:12
@melloware
melloware merged commit 96ecd15 into orval-labs:master Jul 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

angular Related to Angular generation issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(angular): required+nullable query params are silently dropped without a paramsSerializer

3 participants