fix(typescript-angular): skip null and undefined fields in non-exploded object query params

TH
3d ago
+227-72

Since #22459 non-exploded object query param goes through concatHttpParamsObject, and it calls toString() on every field
So {name: 'John', age: undefined} throws TypeError: Cannot read properties of undefined (reading 'toString') while request is built, same for null field or null item inside array field
explode: true and deepObject already skip such fields, and before #22459 they were skiped for every object param

Now null/undefined field is skipped together with its key, and null/undefined array items are dropped
Object where every field is undefined gives filter=, same as empty array gives ids= in existing spec

Added cases to api.query_param_form.spec.ts in typescript-angular-v20 sample, comma one fails on master with that TypeError
In regenerated samples only query.params.ts changes

Follow up to cubic note on #24964, I left it out of scope there

Fixes #22575

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    Commit all changed files.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @topce @akehir @petejohansonxo @amakhrov @davidgamero @mkusaka @joscha @KannaKim


Summary by cubic

Fixes a TypeError in TypeScript Angular generated clients when non-exploded object query params contain null or undefined fields.

Bug Fixes

  • Null and undefined fields are skipped with their keys, null/undefined array items are dropped, and array fields with no remaining items are skipped entirely, matching explode: true and deepObject behavior.
  • Adds tests covering undefined fields, null array items, and empty arrays in exploded and non-exploded form query params.