opensearch-php
opensearch-php copied to clipboard
[FEATURE]Add deprecation warnings for Endpoint usage deviation from Specification
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.