Skip to content

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions