Repository navigation
Labels
coreIssues related to @common-grants/core libraryIssues related to @common-grants/core libraryfeatureNew capability. Belongs on a hold branch.New capability. Belongs on a hold branch.
Milestone
Description
Summary
Problem: Currently the POST /common-grants/opportunities/search request body includes a search property for the search term, alongside filters, pagination, sorting and while these other properties have equivalent values in the response body (filterInfo, sortInfo, paginationInfo) there is no search or searchInfo in the request body, which means that clients don't get the same confirmation about what search term was used for the response like they do with the other properties.
Recommendation: We should include some property in the response body that confirms the search term used. There are a few smaller sub-decisions that need to be answered:
- What do we call it?
searchInfoto matchfilterInfo,paginationInfo,sortInfosearchto keep it consistent with the input?- Personally I'd lean toward
searchInfo, but could be persuaded.
- Where does it get added in the spec?
- To the base
Filtered<T>response schema likely easier and keeps all filtered responses consistent, but also suggests that each filtered responses would support keyword search, which might not be true. - Just adding it just to the opportunity search response, which doesn't impose this extra prop on all filtered responses, but would make this messier
- To the base
- Is it optional or required?
- Making it optional would prevent this from being a breaking change for existing API implementations, but is inconsistent with other attributes in the response model.
- Making it required keeps them consistent, but makes this a breaking change.
- I'd probably opt for optional at least in the next release.
Screenshots
Acceptance criteria
- Answers to the questions above, and their rationale are documented on this ticket after a verbal discussion with @widal001 and the other engineers.
- API clients can see some attribute that confirms the search term used in the opportunity response body
- The corresponding docs, OpenAPI spec and response docs, have been updated with this new property
Metadata
Metadata
Assignees
Labels
coreIssues related to @common-grants/core libraryIssues related to @common-grants/core libraryfeatureNew capability. Belongs on a hold branch.New capability. Belongs on a hold branch.
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][Core] Add `searchInfo` property to the opportunity search reponse[/-][+][Core] Add `searchInfo` property to the opportunity search response[/+]karinamzalez commentedon Nov 19, 2026
Update after discussing with @widal001: the new response model will be named
SearchResults(withSearchResultsT/SearchResultsBase) instead ofSearched, and both opportunity and award search will return it.searchInfo: { query }stays optional and ships in v0.6.0. RenamingPaginated/Sorted/Filteredto match is tracked separately in #1419, since it may need its own release if it turns out to be breaking.feat(core): add searchInfo to the opportunity and award search respon…