openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

Improve querySerializer

Open petr-like opened this issue 1 year ago • 1 comments

Changes

Added filtering after forming query parameters in querySerialize.

How to Review

Currently, if there is any key in queryParams with an empty object, the result of the generation will include a double ampersand.

For example:

{
      a: 1,
      b: {},
      c: 3,
}

will return => example.com?a=1&&c=3 Because Serialize creates an array with an empty string.

After the improvement, it will be example.com?a=1&c=3

Checklist

  • [ ] Unit tests updated
  • [ ] docs/ updated (if necessary)
  • [ ] pnpm run update:examples run (only applicable for openapi-typescript)

petr-like avatar Jul 24 '24 18:07 petr-like