Repository navigation
feat(core): add searchInfo to the opportunity and award search responses - #1421
Merged
karinamzalez merged 3 commits intoNov 23, 2026
Merged
Conversation
…search routes
Opportunity and award search now return `SearchResultsT`, which extends the
filtered response with an optional `searchInfo: SearchResultsInfo { query }`
confirming the search term used. All new models are added in v0.6.0, and
`@returnTypeChangedFrom` keeps both search routes on `FilteredT` before v0.6.0.
The `searchInfo` doc says it is omitted when there is no search term (empty or
whitespace-only counts as none). The search route descriptions now mention the
search term, which also updates that one description line in the 0.1.0 to
0.5.0 OpenAPI documents; their schemas are unchanged.
Refs #959
Files changed:
- lib/core/lib/core/responses/success.tsp
- lib/core/lib/api.tsp
- lib/core/lib/core/routes/opportunities.tsp
- lib/core/lib/core/routes/awards.tsp
- website/public/openapi/openapi.0.{1,2,3,4,5,6}.0.yaml
- website/public/schemas/yaml/SearchResults.yaml
- website/public/schemas/yaml/SearchResultsInfo.yaml
Adds a Search results page under protocol/responses that documents the `SearchResults` response and its `SearchResultsInfo` model added in v0.6.0, with a table, example, JSON Schema and TypeSpec tabs, a usage snippet and the changelog. Links it from the responses overview and orders it after Filtered. Also fixes the sibling response pages: TypeSpec line ranges for Filtered, Created and Accepted now cover the right models, the Filtered and Sorted examples use the real `sortInfo` fields (`sortBy` / `sortOrder`), and the Filtered usage snippet adds `using CommonGrants;` so `Filters` resolves. Refs #959 Files changed: - website/src/content/docs/protocol/responses/search-results.mdx - website/src/content/docs/protocol/responses/index.mdx - website/src/content/docs/protocol/responses/success.mdx - website/src/content/docs/protocol/responses/filtered.mdx - website/src/content/docs/protocol/responses/sorted.mdx - website/src/content/docs/protocol/responses/error.mdx
Contributor
|
🚀 Website Preview Deployed! Preview your changes at: https://pr-1421-common-grants.agile6.workers.dev Built from commit 05fc184 |
SnowboardTechie
approved these changes
Nov 20, 2026
3 tasks
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
searchInfoproperty to the opportunity search response #959Opportunity and award search responses now confirm the search term used, through an optional
searchInfo: { query }added in protocol v0.6.0. RenamingPaginated/Sorted/Filteredto match the newSearchResultsname is out of scope and tracked in #1419. SDK, mock API and template support are not included.Changes proposed
lib/core/lib/core/responses/success.tsp: new "200 search results response" section, all added in v0.6.0:SearchResultsInfowith a requiredquery: stringSearchResultsBase<ItemsT, FilterT>:FilteredBaseplus an optionalsearchInfo, omitted when the request had no search term (empty or whitespace-only counts as none)SearchResultsandSearchResultsT<ItemsT, FilterT>, mirroringFiltered/FilteredTlib/core/lib/core/routes/opportunities.tsp,lib/core/lib/core/routes/awards.tsp: search returnsSearchResultsT; route description now mentions the search termlib/core/lib/api.tsp:@returnTypeChangedFrom(v0_6, ...FilteredT...)on both search ops, so 0.1.0 to 0.5.0 keep their old response schema (same pattern asop read)website/public/openapi/openapi.0.6.0.yaml:searchInfoon both search responses, plus the two new component schemaswebsite/public/openapi/openapi.0.{1..5}.0.yaml: only the search route description line changeswebsite/public/schemas/yaml/SearchResults.yaml,SearchResultsInfo.yaml: newwebsite/src/content/docs/protocol/responses/):search-results.mdx: new page forSearchResultsandSearchResultsInfoindex.mdx: card for the new pageerror.mdx: sidebar order bumped so Search results sits after Filteredsuccess.mdx: Created and Accepted TypeSpec line ranges point at the right models againfiltered.mdx,sorted.mdx: examplesortInfouses the realsortBy/sortOrderfields;filtered.mdxline range and usage snippet (using CommonGrants;) fixedContext for reviewers
The
@returnTypeChangedFromdecorators inapi.tspdeserve the closest look. Without them, the response schema changes in all five older OpenAPI documents.Design decisions (name, placement, shape, optional) are recorded in this comment on #959.
To verify:
pnpm --filter website run typespecgrep -n searchInfo website/public/openapi/openapi.0.6.0.yamlgit diff origin/CORE-v0.6.0 -- 'website/public/openapi/openapi.0.[1-5].0.yaml'/protocol/responses/search-results/on the preview deploy and confirm the table, example, tabs and changelog render.Additional information
Preview: Search results page
Search results page, intro and table with the

searchInforowFormats section, Example tab

Core CI:
Website checks and tests:
searchInfoinopenapi.0.6.0.yaml(two search responses plus theSearchResultscomponent):Only change to the 0.1.0 to 0.5.0 documents: