Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing description parameters in external_value constructor all #860

Merged
merged 5 commits into from
Jan 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/apis/subsystems/external/writing-a-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ Because some web service protocols are strict about the number and types of argu
```php
public static function get_biscuit_parameters() {
return new external_function_parameters([
'chocolatechips' => new external_value(PARAM_BOOL, PARAM_REQUIRED),
'glutenfree' => new external_value(PARAM_BOOL, PARAM_DEFAULT, false),
'chocolatechips' => new external_value(PARAM_BOOL, 'if biscuit contains chocolate chips', PARAM_REQUIRED),
PhMemmel marked this conversation as resolved.
Show resolved Hide resolved
'glutenfree' => new external_value(PARAM_BOOL, 'if biscuit is glutenfree', PARAM_DEFAULT, false),
sarjona marked this conversation as resolved.
Show resolved Hide resolved
// ERROR! top level optional parameter!!!
'icingsugar' => new external_value(PARAM_BOOL, VALUE_OPTIONAL),
'icingsugar' => new external_value(PARAM_BOOL, 'if biscuit has icing sugar on top', VALUE_OPTIONAL),
]);
}
```
Expand All @@ -332,10 +332,10 @@ public static function get_biscuit_parameters() {
public static function get_biscuit_parameters() {
return new external_function_parameters([
'ifeellike' => new external_single_structure([
'chocolatechips' => new external_value(PARAM_BOOL, VALUE_REQUIRED),
'glutenfree' => new external_value(PARAM_BOOL, PARAM_DEFAULT, false),
'chocolatechips' => new external_value(PARAM_BOOL, 'if biscuit contains chocolate chips', VALUE_REQUIRED),
andrewnicols marked this conversation as resolved.
Show resolved Hide resolved
'glutenfree' => new external_value(PARAM_BOOL, 'if biscuit is glutenfree', PARAM_DEFAULT, false),
// ALL GOOD!! We have nested the params in a external_single_structure.
'icingsugar' => new external_value(PARAM_BOOL, VALUE_OPTIONAL),
'icingsugar' => new external_value(PARAM_BOOL, 'if biscuit has icing sugar on top', VALUE_OPTIONAL),
]),
]);
}
Expand Down
Loading