config-schema: schema wrongly allowed ui.pager.command to be a string

While `ui.pager` can be a string which will be tokenized on whitespace,
and argument token array, or a command/env table, the `command` key
within that table currently must be an array. The schema previously
explicitly also allowed it to be a string but that does not actually
work, as exemplified by running:
```sh
$ jj --config-file cli/tests/sample-configs/invalid/ui.pager_command-env_string.toml config list
Config error: Invalid type or value for ui.pager
Caused by: data did not match any variant of untagged enum CommandNameAndArgs
```

`CommandNameAndArgs` should potentially be changed to allow strings.
For now, the schema has been updated to reflect the status quo. A new
sample toml has been added to the `invalid` directory to cover this;
prior to updating the schema, this new test case failed. Once the
behavior is changed to allow string, the file merely needs to be moved
to `valid`.
This commit is contained in:
Jonas Greitemann 2025-04-16 13:57:01 +02:00 committed by Jonas Greitemann
parent d4024e0d92
commit 5444067c37
3 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,7 @@
"type": "object",
"properties": {
"command": {
"type": ["array", "string"],
"type": "array",
"items": {
"type": "string"
}

View File

@ -0,0 +1,3 @@
#:schema ../../../src/config-schema.json
[ui.pager]
command = "bat -p"