Skip to content

defaultQuerySerializer does not handle empty array correctly #1403

Closed
@stefanprobst

Description

@stefanprobst

Description

the default query serializer (v0.8.0) seems to not handle empty arrays correctly.

Reproduction

import { defaultQuerySerializer } from "openapi-fetch";

console.log(
  defaultQuerySerializer({
    q: "term",
    categories: [],
    search: [],
    limit: 10,
    offset: 0,
  })
);

// logs:
// q=term&&&limit=10&offset=0
//       ^^^

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions