From 9c302ebe382e83537e4801eac5cfaadcd3a7d2a8 Mon Sep 17 00:00:00 2001 From: Lukas Waslowski Date: Mon, 8 Sep 2025 15:35:44 +0200 Subject: [PATCH 1/3] Improve the description of the addon options schema field types --- docs/add-ons/configuration.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/add-ons/configuration.md b/docs/add-ons/configuration.md index e5a781a9e8c..7cf498849e0 100644 --- a/docs/add-ons/configuration.md +++ b/docs/add-ons/configuration.md @@ -243,17 +243,18 @@ not_need: "str?" We support: -- `str` / `str(min,)` / `str(,max)` / `str(min,max)` -- `bool` -- `int` / `int(min,)` / `int(,max)` / `int(min,max)` -- `float` / `float(min,)` / `float(,max)` / `float(min,max)` -- `email` -- `url` -- `password` -- `port` -- `match(REGEX)` -- `list(val1|val2|...)` -- `device` / `device(filter)`: Device filter can be in the following format: `subsystem=TYPE` i.e. `subsystem=tty` for serial devices. +- `str` / `str(min,)` / `str(,max)` / `str(min,max)`: Arbitrary string with optional min/max length. +- `bool`: `true`/`false`. Will attempt to parse strings and numbers as boolean values. +- `int` / `int(min,)` / `int(,max)` / `int(min,max)`: Integer with optional lower/upper bound (inclusive). +- `float` / `float(min,)` / `float(,max)` / `float(min,max)`: Floating point number with optional lower/upper bound (inclusive). +- `email`: A string representing an email address. +- `url`: A string representing an URL. +- `password`: A string representing a password. +- `port`: A integer representing a port number. Will attempt to parse strings as port numbers. +- `match(REGEX)`: A string matching the specified regular expression. +- `list(val1|val2|...)`: A string from a fixed set (`val1`, `val2`, ...) of values. +- `device` / `device(filter)`: A string referencing a device path (e.g. `/dev/ttyS0`). + Device filter can be in the following format: `subsystem=TYPE` (e.g. `subsystem=tty` for serial devices). ## Add-on extended build From 6b1ffc9191fc65703fa0ac0a36f922c74aa9e0e8 Mon Sep 17 00:00:00 2001 From: Lukas Waslowski Date: Mon, 8 Sep 2025 15:41:57 +0200 Subject: [PATCH 2/3] Explicitly mention usage of lists and dicts in addon option schemas --- docs/add-ons/configuration.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/add-ons/configuration.md b/docs/add-ons/configuration.md index 7cf498849e0..923895e6fdb 100644 --- a/docs/add-ons/configuration.md +++ b/docs/add-ons/configuration.md @@ -255,6 +255,16 @@ We support: - `list(val1|val2|...)`: A string from a fixed set (`val1`, `val2`, ...) of values. - `device` / `device(filter)`: A string referencing a device path (e.g. `/dev/ttyS0`). Device filter can be in the following format: `subsystem=TYPE` (e.g. `subsystem=tty` for serial devices). +- Lists of some underlying element type: + ```yaml + random: + - "match(^\\w*$)" +- Nested dictionaries, e.g.: + ```yaml + logins: + - username: str + password: str + ``` ## Add-on extended build From 779398cc4fab5a6bf191bdf2da636ec9db7b6a6f Mon Sep 17 00:00:00 2001 From: Lukas Waslowski Date: Mon, 8 Sep 2025 16:12:13 +0200 Subject: [PATCH 3/3] Apply automated suggestions from code review --- docs/add-ons/configuration.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/add-ons/configuration.md b/docs/add-ons/configuration.md index 923895e6fdb..70dfe91755e 100644 --- a/docs/add-ons/configuration.md +++ b/docs/add-ons/configuration.md @@ -244,22 +244,22 @@ not_need: "str?" We support: - `str` / `str(min,)` / `str(,max)` / `str(min,max)`: Arbitrary string with optional min/max length. -- `bool`: `true`/`false`. Will attempt to parse strings and numbers as boolean values. +- `bool`: Boolean (`true`/`false`). - `int` / `int(min,)` / `int(,max)` / `int(min,max)`: Integer with optional lower/upper bound (inclusive). - `float` / `float(min,)` / `float(,max)` / `float(min,max)`: Floating point number with optional lower/upper bound (inclusive). - `email`: A string representing an email address. - `url`: A string representing an URL. - `password`: A string representing a password. -- `port`: A integer representing a port number. Will attempt to parse strings as port numbers. +- `port`: An integer representing a TCP/UDP port (1 – 65535). - `match(REGEX)`: A string matching the specified regular expression. - `list(val1|val2|...)`: A string from a fixed set (`val1`, `val2`, ...) of values. - `device` / `device(filter)`: A string referencing a device path (e.g. `/dev/ttyS0`). Device filter can be in the following format: `subsystem=TYPE` (e.g. `subsystem=tty` for serial devices). -- Lists of some underlying element type: +- Lists of some underlying element type. For example: ```yaml random: - "match(^\\w*$)" -- Nested dictionaries, e.g.: +- Nested dictionaries. For example: ```yaml logins: - username: str