fix: use jackson 2 compatible mapper for extensionquery by netomi · Pull Request #2061 · eclipse-openvsx/openvsx · GitHub
Skip to content

fix: use jackson 2 compatible mapper for extensionquery - #2061

Merged
netomi merged 2 commits into
mainfrom
fix-jackson-config-for-extensionquery
Aug 8, 2026
Merged

netomi merged 2 commits into
mainfrom
fix-jackson-config-for-extensionquery

Conversation

@netomi

@netomi netomi commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

This fixes #2059.

The GET variant for the extensionquery endpoint uses its own JsonMapper instead of an injected one. The default JsonMapper has now backwards compatible settings for Jackson 2, use that mapper also for the VSCodeAPI.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns the /vscode/gallery/extensionquery GET implementation with the application-wide Jackson configuration to restore Jackson 2–compatible deserialization behavior (notably around missing/null primitive fields) and improves diagnostics for invalid GET query payloads.

Changes:

  • Injects the Spring-managed JsonMapper into VSCodeAPI instead of building a standalone mapper.
  • Enhances the GET extensionquery parse failure error message to include the underlying Jackson parse message.
  • Adds/extends MVC tests for the GET q= variant and wires JacksonConfig into the web test slice.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAPI.java Uses injected JsonMapper for GET q= parsing and improves bad-request diagnostics.
server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java Adds GET coverage for extensionquery?q=... and ensures JacksonConfig is active in the slice test context.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAPI.java Outdated
Comment thread server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java
- Sanitize and bound the Jackson parse-failure message before putting
  it into the ResponseStatusException reason: strip control
  characters/newlines and truncate to 200 chars, since it is derived
  from attacker-controlled input and Spring propagates the reason into
  the response status line.
- Add a POST regression test for #2059 (the
  actual reported incident), confirming the @RequestBody path fixed by
  JacksonConfig (#2052) still works end-to-end with pageNumber missing
  from the sibling sortBy/sortOrder fields.
- Add a test asserting the sanitized message is single-line and length
  bounded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@netomi
netomi merged commit 0648bd0 into main Aug 8, 2026
6 checks passed
@netomi
netomi deleted the fix-jackson-config-for-extensionquery branch August 8, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants