feat!: echo the query and return the answer under a in batch results - #10
Merged
Conversation
Batch-style results now echo their query and carry the answer under `a`
instead of a lean `{"username": ...}`:
{"u":"test@example.org","s":"jira","q":"slack","a":"U123456"}
- POST /whose-name/query/batch: each item echoes u, s, q and the answer a.
- GET /whose-name/pool: same shape per member, mapping u = member name,
s = the pool's field, q = the asked service, a = the answer.
Status semantics are unchanged (200 all resolved / 207 any null / 422
malformed body; 404 for an unknown pool). Results are now self-describing,
so clients can correlate by content rather than only by order.
Presentation only: the route reads the pool for its members/field and zips
it with PoolService::whatAreTheNamesOf, which still returns a plain list, so
whoseNamesAreThere and the flattened /pool/names endpoint are unaffected.
The single GET /query endpoint is intentionally left as {"username": ...}.
Docs: README examples updated; the 2026-07-06 batch ADL is superseded for
its response shape (status/validation decisions still hold) by a new ADL.
BREAKING CHANGE: batch (/query/batch) and pool (/pool) result items changed
their key from `username` to `a` and gained `u`, `s`, `q`. Clients of those
endpoints must migrate. The single /query endpoint is unchanged.
Co-Authored-By: Claude Opus 4.8 (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.
Summary
Batch-style results now echo their query and carry the answer under
a, instead of the lean{"username": ...}:{"u":"test@example.org","s":"jira","q":"slack","a":"U123456"}This makes each result self-describing — clients can correlate by content, not only by position.
Changes
POST /api/whose-name/query/batch— each item echoesu,s,qand the answera:GET /api/whose-name/pool— same shape per member, with the pool mapping:u= member name,s= the pool's field,q= asked service,a= answer:Status semantics are unchanged:
200all resolved ·207anynull·422malformed body ·404unknown pool.Design
/poolroute reads the pool (for its members/field) and zips it withPoolService::whatAreTheNamesOf, which still returns a plain list — sowhoseNamesAreThereand the flattened/pool/namesendpoint ({"names":[...]}) are unaffected.GET /queryendpoint is intentionally left as{"username": ...}.Docs
2026-07-06batch ADL is marked superseded for its response shape (its status/validation decisions still hold); new ADL2026-07-08-batch-query-echoes-input.mdrecords the echo decision and/pooladopting the same shape.Testing
Full suite passes via
./vendor/bin/sail test— 51 passed, 2 skipped (pre-existing filesystem-atime skips). Batch and pool endpoint tests updated to assert the{u,s,q,a}shape across 200/207/404 and the same-field shortcut.Batch (
/query/batch) and pool (/pool) result items changed their key fromusernametoaand gainedu,s,q. Clients of those endpoints must migrate — notably whose-name-client (not touched here). The single/queryendpoint is unchanged.🤖 Generated with Claude Code