-
Notifications
You must be signed in to change notification settings - Fork 52
Add support for rest.scope.list #408
Description
Problem
The Bitrix24 REST API v3 method `rest.scope.list` is not yet supported by the SDK.
The method is present in the OpenAPI schema (`docs/open-api/openapi.json`) and returns a list of available scopes with optional filtering by module, controller, or method name.
Proposed solution
Add a service method that wraps `rest.scope.list` following the existing patterns in `src/Services/`.
Since the method belongs to the `rest` scope, the implementation should go into a new `Rest` service builder and service class under `src/Services/Rest/`.
Response structure
The method returns a nested map (not a flat list): `module → controller → method → item`.
Example call with `filterModule=rest`:
```json
{
"result": {
"rest": {
"scope": {
"list": {
"scope": "rest.scope.list",
"title": "List метод для scope",
"description": "Метод для получения всех доступных scope приложения",
"fields": null
}
}
}
},
"time": { ... }
}
```
Each leaf item has:
- `scope` — full method name (e.g. `rest.scope.list`)
- `title` — human-readable title
- `description` — description
- `fields` — `null` or field metadata
The result class must flatten the nested structure into a list of `ScopeMethodItemResult` objects.
Parameters
- `filterModule` (string, optional) — filter by module name (e.g. `rest`, `tasks`)
- `filterController` (string, optional) — filter by controller name
- `filterMethod` (string, optional) — filter by method name
Acceptance criteria
- `RestServiceBuilder` registered in `src/Services/ServiceBuilder.php`
- `Rest\Service\Scope` service class implements `rest.scope.list` with parameter mapping (`filterModule`, `filterController`, `filterMethod`)
- Result class flattens the nested `module → controller → method` response into a flat list
- Result item `@property-read` annotations cover all response fields: `scope`, `title`, `description`, `fields`
- `ApiEndpointMetadata('rest.scope.list', ...)` attribute present with `ApiVersion::v3`
- Unit test passes (`make test-unit`)
- Integration test passes, including annotation and type-cast checks
- `CHANGELOG.md` is updated with an issue link