Let a catalog search name a scope without a query - #8
Merged
Merged
Conversation
The gateway's ranked search accepts any non-empty combination of q,
category and platform, so /catalog/search?platform=reddit is a 200. The
node could not express that: searchRequest opened with `{ q: query }` and
the Query field was required, so "every reddit API" was reachable over
MCP and over curl but not from a workflow.
Query is now optional and searchRequest omits q entirely when it is
empty, matching how browseRequest treats an absent category. This does
not change what a saved workflow sends: one with a filled Query still
sends the same q, and one that left Query empty was already sending an
empty q that the gateway reads as absent, so it keeps the results it had.
A search naming none of the three is rejected at the operation boundary
with a NodeOperationError, alongside the existing Max Items validation,
rather than being sent to the gateway to earn a 400. discovery.ts keeps
owning the wire contract and the node keeps owning n8n-facing errors.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
The gateway's ranked search requires at least one of
q,category,platform, in any combination. Measured against production today:The node was stricter.
searchRequestopened withconst qs: IDataObject = { q: query }and the Query field wasrequired: true, so "every reddit API" or "everything in the social category" was expressible over MCP and over curl but impossible from a workflow. Gateway PR getanyapi-com/anyapi#1013 relaxed the MCP side; this node was never updated.What changed
searchRequestomitsqentirely when the query is empty, matching howbrowseRequestalready treats an absent category. It never sendsqempty.NodeOperationError, next to the existing Max Items validation, and never reaches the gateway.discovery.tskeeps owning the wire contract and the node keeps owning n8n-facing errors, so the SeamAGENTS.mddescribes is preserved.This does not change what a saved workflow sends
A saved workflow with Query filled sends the same
qit always sent. Proven by an assertion in the new test.A saved workflow that left Query empty was already sending
q=empty, and the gateway reads an emptyqas absent. Measured against production:So dropping the empty
qreturns the identical result set.A saved workflow with neither now gets a clear node error instead of a gateway 400.
No limit, default, or cap was introduced. The tolerant-reader rules are untouched: the reader still rejects
creditkeys and anyproviderthat is not"AnyAPI", and nothing derives or repairs relationships among returned fields.Proof
Gate, on this branch:
Both new tests were confirmed red against the pre-fix
searchRequestand with the guard removed:Live against
https://api.getanyapi.com, driven through the node's realexecuteseam with the builtdist/:Note the two rankings: a scope with no query ranks
keyword, a query rankssemantic. Both come from the gateway; the node reports what it is told.Not in this PR
No version bump, tag, or npm publish. Releasing is a separate decision.
The sibling fix for the CLI is getanyapi-com/cli#17.
🤖 Generated with Claude Code