fix(agent-bff): expose search on unfolded request schemas - #1863
Conversation
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
nbouliol
left a comment
There was a problem hiding this comment.
Read against PRD-1103 and the repo standards. The fix itself is right: search / searchExtended land on the unfolded ListRequest_* / CountRequest_* as $refs to shared components, the property order matches the generic ListRequestSchema / CountRequestSchema so the new parity test passes for the right reason, and relations inherit both through the allOf head. ActionRequest is the only other generic request shape and it has no missing input, so nothing else of this bug class is open. Two wording notes below.
|
Review pass done — GO, no findings on the change itself. Every claim checked against the runtime: all four path families really do honour It did surface two pre-existing omissions in the same prose I was already editing, so they are fixed here rather than left for a third pass:
Both now name every input that travels in the body. One thing worth flagging for whoever merges: this PR and #1855 touch the same lines from opposite directions. #1855 closes the request bodies with |
nbouliol
left a comment
There was a problem hiding this comment.
Approving. The fix is right where it matters: search / searchExtended land on the unfolded ListRequest_* / CountRequest_* as $refs to one shared component pair registered like Page and Timezone, the property order matches the generic ListRequestSchema / CountRequestSchema so the new parity test passes for the right reason, and relations inherit both through the allOf head. ActionRequest is the only other generic request shape and it carries no missing input, so nothing else of this bug class is open.
Both wording notes addressed — the README sentence now names search (and sort), and the count description reuses the generic phrasing.
f1cf465 to
1ad9d90
Compare

What
The unfolded (per-collection) OpenAPI document exposes
searchandsearchExtendedon every list and count request. Generated clients were missing both inputs although the runtime honours them on all four path families — list, count, relation list, relation count.ListRequest_<key>andCountRequest_<key>carrysearch/searchExtendedas$refs to one sharedSearch/SearchExtendedpair, registered throughComponentPool.reuseexactly likePageandTimezone.allOfhead.fixes PRD-1103
Overlaps with #1855
That branch closes the request bodies (
additionalProperties: false) and, to do it, had to publishsearch/searchExtendedon the unfolded bodies too — a closed body that omits an input the runtime accepts would declare valid requests invalid. So the two PRs touch the same lines, deliberately, from opposite directions.Whichever lands second will conflict on
registerRequests. #1855 also flattens the relation bodies out of theirallOf, so the "relations inherit through theallOfhead" sentence above becomes stale once it merges — the inputs then arrive by spread instead, and the outcome for a consumer is identical.Known limitation
Same as the generic document: a collection that is not searchable still shows a documented
searchinput, and using it answers 400 "Collection is not searchable". Gating on a searchable flag needs a signal the BFF capabilities do not carry today.How to test
yarn workspace @forestadmin/agent-bff test test/openapi— redocly lint over the served document includedyarn workspace @forestadmin/agent-bff testDefinition of Done
General
Security