Skip to content

[Core] Add searchInfo property to the opportunity search response #959

Closed

Description

@widal001

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

Image Image

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

Activity

  1. added theissue type on Jun 27, 2026
  2. changed the title [-][Core] Add `searchInfo` property to the opportunity search reponse[/-] [+][Core] Add `searchInfo` property to the opportunity search response[/+] on Nov 4, 2026
  3. added
    coreIssues related to @common-grants/core library
    on Nov 4, 2026
  4. moved this from In Progress to Blocked in Simpler Grants Product & Deliveryon Nov 16, 2026
  5. moved this from Blocked to In Progress in Simpler Grants Product & Deliveryon Nov 19, 2026
  6. karinamzalez commented on Nov 19, 2026

    @karinamzalez
    Collaborator

    Update after discussing with @widal001: the new response model will be named SearchResults (with SearchResultsT / SearchResultsBase) instead of Searched, and both opportunity and award search will return it. searchInfo: { query } stays optional and ships in v0.6.0. Renaming Paginated / Sorted / Filtered to match is tracked separately in #1419, since it may need its own release if it turns out to be breaking.

  7. moved this from In Progress to In Review in Simpler Grants Product & Deliveryon Nov 19, 2026
  8. added a commit that references this issue on Nov 23, 2026
    ea6584e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreIssues related to @common-grants/core libraryfeatureNew capability. Belongs on a hold branch.

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions