Skip to content

Array serialization style for query params does not match the spec #3630

@jonathan-blueocean

Description

@jonathan-blueocean

Description

edit: It looks like serializeArrayParam is built to the spec for path params, but not query params. It may be that createQuerySerializer should be using a different array serializer.

It appears the implementation of serializeArrayParam does not match the spec. Looking at the Swagger spec, arrays can be serialized as "form", "spaceDelimited", or "pipeDelimited". The implementation of serializeArrayParam handles "label", "matrix", and "simple". I'm not very experienced with OpenAPI, so I'm not sure what those are, but they don't appear to be valid array serialization styles. Please, let me know if I'm not understanding the spec or implementation properly.

Reproducible example or configuration

This serializer still uses the "form" style of query param serialization.

const querySerializer = createQuerySerializer({
  array: {
    style: 'pipeDelimited',
  },
});

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Broken or incorrect behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions