Skip to content

Fix deepObject query parsing with unrelated parameters - #1285

Merged
marle3003 merged 1 commit into
marle3003:mainfrom
bensynapse:fix-deep-object-query-parameters
Oct 5, 2026
Merged

marle3003 merged 1 commit into
marle3003:mainfrom
bensynapse:fix-deep-object-query-parameters

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

I run Live Tennis API.

A request such as ?filter[role]=admin&page=2 panics when filter is a deepObject parameter. The parser indexes a missing regex match for page. It also accepts prefixed or suffixed lookalikes and interprets punctuation in parameter names as regex syntax.

Match the complete object parameter name literally and skip other query fields. Add regressions for scalar pagination, two objects, lookalikes, punctuation and existing default, required and schema validation behavior.

Checks:

  • The 23 new cases pass with go test -race ./providers/openapi -run TestParseQueryDeepObject -count=1. Nineteen fail with the original parser.
  • The full coverage suite passes with Go 1.27.1, an isolated temporary directory, GOMAXPROCS=2, -p 1 and -parallel 1.
  • The web build and CLI build pass. Six HTTP checks pass with the compiled CLI in an Alpine container.

The Docker build fails in TestStore/reply_not_valid and TestConfigWatcher_Read/file_changed_after_read. The OpenAPI package passes there. Both failing tests also pass in the isolated native suite.

@marle3003 marle3003 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Appreciate you taking the time to fix this bug.

@marle3003
marle3003 merged commit 8ed7d2f into marle3003:main Oct 5, 2026
5 checks passed
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.

2 participants