Skip to content
Merged
Changes from all commits
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
feat: allow setting system config values with json value
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed May 12, 2025
commit 7f019e3a14991fae26e358643b733acaee1fd09b
9 changes: 8 additions & 1 deletion core/Command/Config/System/SetConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ protected function castValue($value, $type) {
'readable-value' => ($value === '') ? 'empty string' : 'string ' . $value,
];

case 'json':
$value = json_decode($value, true);
return [
'value' => $value,
'readable-value' => 'json ' . json_encode($value),
];

default:
throw new \InvalidArgumentException('Invalid type');
}
Expand Down Expand Up @@ -183,7 +190,7 @@ protected function mergeArrayValue(array $configNames, $existingValues, $value,
*/
public function completeOptionValues($optionName, CompletionContext $context) {
if ($optionName === 'type') {
return ['string', 'integer', 'double', 'boolean'];
return ['string', 'integer', 'double', 'boolean', 'json', 'null'];
}
return parent::completeOptionValues($optionName, $context);
}
Expand Down
Loading