Skip to content

Commit 272d306

Browse files
Enhance documentation for input and output schemas (#141)
Updated input_schema and output_schema descriptions to include JSON Schema links for better clarity.
1 parent 99e62d4 commit 272d306

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/php-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ The `$args` array accepts the following keys:
121121
- `label` (`string`, **Required**): A human-readable name for the ability. Used for display purposes. Should be translatable.
122122
- `description` (`string`, **Required**): A detailed description of what the ability does, its purpose, and its parameters or return values. This is crucial for AI agents to understand how and when to use the ability. Should be translatable.
123123
- `category` (`string`, **Required**): The slug of the category this ability belongs to. The category must be registered before registering the ability using `wp_register_ability_category()`. Categories help organize and filter abilities by their purpose. See [Registering Categories](#registering-categories) for details.
124-
- `input_schema` (`array`, **Optional**): A JSON Schema definition describing the expected input parameters for the ability's execute callback. Only needed when creating Abilities that require inputs. Defaults to `null` only when no schema is provided. Used for validation and documentation.
125-
- `output_schema` (`array`, **Required**): A JSON Schema definition describing the expected format of the data returned by the ability. Used for validation and documentation.
124+
- `input_schema` (`array`, **Optional**): A [JSON Schema](https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/) definition describing the expected input parameters for the ability's execute callback. Only needed when creating Abilities that require inputs. Defaults to `null` only when no schema is provided. Used for validation and documentation.
125+
- `output_schema` (`array`, **Required**): A [JSON Schema](https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/) definition describing the expected format of the data returned by the ability. Used for validation and documentation.
126126
- `execute_callback` (`callable`, **Required**): The PHP function or method to execute when this ability is called.
127127
- The callback receives one optional argument, the input data for the ability. The argument is required when the input schema is defined.
128128
- The input argument will have the same type as defined in the input schema (e.g., `array`, `object`, `string`, etc.).

0 commit comments

Comments
 (0)