Roadmap for availability of JSON RPC plugins/methods.

Created on 8 November 2020, over 4 years ago
Updated 31 August 2024, 9 months ago

Problem/Motivation

Hi I want to use this as a consumer of methods to administer Drupal from Javascript and my main focus is available methods.

GET /jsonrpc/methods currently returns a small collection of items. Do you plan to include additional methods in core module or will that be left to contrib modules to expose more plugins to consumers?

Is there a roadmap for a default/minimal set of methods available in the core JSON RPC module?

Is this list a complete set of ALL available JSONRPC plugins or are there easy ways to expose other/any plugins from core and contrib modules to the JSONRPC interface?

Steps to reproduce

Install module

GET https://site.example/jsonrpc/methods returns

Observe: drupal returns a small collection of methods.

{
"data": [
{
"type": "JsonRpcMethod",
"id": "route_builder.rebuild",
"attributes": {
"usage": "Rebuilds the application's router. Result is TRUE if the rebuild succeeded, FALSE otherwise"
},
"links": {
"self": "http://drupal894.syntapse.co.uk/jsonrpc/methods/route_builder.rebuild",
"collection": "http://drupal894.syntapse.co.uk/jsonrpc/methods"
}
},
{
"type": "JsonRpcMethod",
"id": "user_permissions.add_permission_to_role",
"attributes": {
"usage": "Add the given permission to the specified role.",
"params": {
"permission": {
"type": "JsonRpcParameterDefinition",
"id": "permission",
"attributes": {
"schema": {
"type": "string"
}
},
"schema": {
"type": "string"
}
},
"role": {
"type": "JsonRpcParameterDefinition",
"id": "role",
"attributes": {
"factory": "\\Drupal\\jsonrpc\\ParameterFactory\\EntityParameterFactory"
},
"schema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"uuid": {
"type": "string"
}
}
}
}
}
},
"links": {
"self": "http://drupal894.syntapse.co.uk/jsonrpc/methods/user_permissions.add_permission_to_role",
"collection": "http://drupal894.syntapse.co.uk/jsonrpc/methods"
}
},
{
"type": "JsonRpcMethod",
"id": "maintenance_mode.isEnabled",
"attributes": {
"usage": "Enables or disables the maintenance mode.",
"params": {
"enabled": {
"type": "JsonRpcParameterDefinition",
"id": "enabled",
"attributes": {
"schema": {
"type": "boolean"
}
},
"schema": {
"type": "boolean"
}
}
}
},
"links": {
"self": "http://drupal894.syntapse.co.uk/jsonrpc/methods/maintenance_mode.isEnabled",
"collection": "http://drupal894.syntapse.co.uk/jsonrpc/methods"
}
},
{
"type": "JsonRpcMethod",
"id": "user_permissions.list",
"attributes": {
"usage": "List all the permissions available in the site.",
"params": {
"page": {
"type": "JsonRpcParameterDefinition",
"id": "page",
"attributes": {
"factory": "\\Drupal\\jsonrpc\\ParameterFactory\\PaginationParameterFactory"
},
"schema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"minimum": 0
},
"offset": {
"type": "integer",
"minimum": 0
}
}
}
}
}
},
"links": {
"self": "http://drupal894.syntapse.co.uk/jsonrpc/methods/user_permissions.list",
"collection": "http://drupal894.syntapse.co.uk/jsonrpc/methods"
}
},
{
"type": "JsonRpcMethod",
"id": "cache.rebuild",
"attributes": {
"usage": "Rebuilds the system cache."
},
"links": {
"self": "http://drupal894.syntapse.co.uk/jsonrpc/methods/cache.rebuild",
"collection": "http://drupal894.syntapse.co.uk/jsonrpc/methods"
}
},
{
"type": "JsonRpcMethod",
"id": "plugins.list",
"attributes": {
"usage": "List defined plugins.",
"params": {
"page": {
"type": "JsonRpcParameterDefinition",
"id": "page",
"attributes": {
"factory": "\\Drupal\\jsonrpc\\ParameterFactory\\PaginationParameterFactory"
},
"schema": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"minimum": 0
},
"offset": {
"type": "integer",
"minimum": 0
}
}
}
},
"service": {
"type": "JsonRpcParameterDefinition",
"id": "service",
"attributes": {
"schema": {
"type": "string"
},
"required": true
},
"schema": {
"type": "string"
}
}
}
},
"links": {
"self": "http://drupal894.syntapse.co.uk/jsonrpc/methods/plugins.list",
"collection": "http://drupal894.syntapse.co.uk/jsonrpc/methods"
}
}
],
"links": {
"self": "http://drupal894.syntapse.co.uk/jsonrpc/methods"
}
}

Proposed resolution

Documentation on default set of methods.

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Closed: outdated

Version

2.0

Component

Documentation

Created by

🇬🇧United Kingdom Syntapse

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024