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?
searchInfo to match filterInfo, paginationInfo, sortInfo
search to 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
- 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
Summary
Problem: Currently the
POST /common-grants/opportunities/searchrequest body includes asearchproperty for the search term, alongsidefilters,pagination,sortingand while these other properties have equivalent values in the response body (filterInfo,sortInfo,paginationInfo) there is nosearchorsearchInfoin 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:
searchInfoto matchfilterInfo,paginationInfo,sortInfosearchto keep it consistent with the input?searchInfo, but could be persuaded.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.Screenshots
Acceptance criteria