Skip to content

json array support for collectionFormat #437

@dtorok

Description

@dtorok

The spec lists several possible formats in the collectionFormat field for an array parameter.
My suggestion is to include json too because

  • we use json everywhere, no need to introduce a new serialization format here
  • json serializer is there already on both the client and server side
  • it's as simple as csv (2 more bytes)

The swagger fragment would look like this:

        - name: id__in
          in: query
          required: false
          type: array
          collectionFormat: json
          items:
            type: integer
            format: int64

The URL would look like this:

https://example.com/api/users/?id__in=[1,2,3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions