Skip to content

extensionquery returns 400 when a filter omits pageNumber, sortBy or sortOrder #2059

Description

@jonyoder

Since around 7 August 2026, POST /vscode/gallery/extensionquery rejects any request whose filter omits pageNumber, sortBy or sortOrder. These previously defaulted.

It is key presence that matters, not the value: "sortBy": 0 is accepted, omitting the key is not.

Reproduce

Fails with 400:

curl -sS -X POST https://open-vsx.org/vscode/gallery/extensionquery \
  -H 'Content-Type: application/json' \
  -d '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"}],"pageSize":10,"pageNumber":1}],"flags":914}'
{"timestamp":"2026-08-08T10:20:12.165Z","status":400,"error":"Bad Request","path":"/vscode/gallery/extensionquery"}

Succeeds — the only difference is sortBy and sortOrder:

curl -sS -X POST https://open-vsx.org/vscode/gallery/extensionquery \
  -H 'Content-Type: application/json' \
  -d '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"}],"pageSize":10,"pageNumber":1,"sortBy":0,"sortOrder":0}],"flags":914}'

Omitting pageNumber fails the same way, so a client that adds only the two sort fields will still get a 400 on any request that left pageNumber out.

Why this is hard to diagnose

The 400 body has no message field, and the endpoint returns 400 for every method and body, including {} and a bare GET. That is indistinguishable from the endpoint being down, which sends you looking for an outage rather than at your own payload. The REST /api surface and the other /vscode/gallery/* routes stay healthy throughout, so it is not an outage.

Ask

Is this change intentional?

  • If yes, it would help a lot if the error body named the missing field. A message would turn this from a bisect into a one-line fix, and it is worth a note in the API docs since these fields previously defaulted.
  • If no, restoring the previous defaults would unbreak clients that omit them.

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