opensearch-php icon indicating copy to clipboard operation
opensearch-php copied to clipboard

[FEATURE]Add deprecation warnings for Endpoint usage deviation from Specification

Open saimedhi opened this issue 1 year ago • 1 comments

Is your feature request related to a problem?

  • Add deprecation warnings to all endpoint usages that deviate from the specification. Specifically, add deprecation warnings to all patches located here. This will facilitate future removal of patches and enable direct generation from the specification.

  • For example, deprecate createPointInTime, deletePointInTimeProxy, and issue a warning to use createPIT and deletePIT instead.

  • Another example involves getRoles proxy:


public function getRoles(array $params = [])
{
    $endpointBuilder = $this->endpoints;
    if (isset($params['role'])) {
        $endpoint = $endpointBuilder('Security\GetRole');
        $role = $this->extractArgument($params, 'role');
        $endpoint->setRole($role);
    } else {
        $endpoint = $endpointBuilder('Security\GetRoles');
    }
    $endpoint->setParams($params);

    return $this->performRequest($endpoint);
}

    In this case, issue a warning when the 'role' parameter is provided, advising to use the 'getRole' endpoint instead of the 'getRoles' endpoint.

What solution would you like?

Include clear and concise deprecation warnings for endpoint usages that do not conform to the specification.

saimedhi avatar Jul 12 '24 05:07 saimedhi

[Catch All Triage - 1, 2, 3]

dblock avatar Aug 05 '24 16:08 dblock