Closed russcam closed 4 years ago
This has been implemented in 08dd846e83699ca6ac72232b66864d0b7d5b46ff, patterning matching on tuples of the optional URL parts, where each optional part may be set or not (Some(T)
or None
). An optional part is a URL part that is not required by all URL variants for an API.
This implementation is problematic per the commit message in 08dd846e83699ca6ac72232b66864d0b7d5b46ff. Closing this issue in favour of opening a new issue to track replacing the implementation with enums
Each API endpoint maps to one or more URL paths, where each path may contain placeholders for URL parts that should be replaced with values supplied by the user. For example,
_search
has the following paths in 7.3.1 Rest API specThe builder for the
_search
API,Search
, should contain anindex
field that when set, results in the API call using the path specifying the index. It's envisaged that this will requireindex
field on the `Search structindex
function onSearch
implementation that sets theindex
fieldSender
traitsend()
function that checks whetherindex
has a value and if it does, creates a path by replacing{index}
in/{index}/_search
with theindex
value, and uses this for the API function.This implementation can be entirely generated from the REST API spec.