Skip to content
Snippets Groups Projects
Commit 400c7c8d authored by Daniel Hornung's avatar Daniel Hornung
Browse files

DOC: Specifying multiple choice checkboxes.

parent bad0b2fa
No related branches found
No related tags found
2 merge requests!107Release v0.11.0,!98Multiple choice arrays for table json converter
Pipeline #49946 passed with warnings
......@@ -252,6 +252,31 @@ For example, this table defines three coaches for the two trainings from the las
| | 2024-02-27 | example.com/mp | Berta |
| | 2024-02-27 | example.com/m | Chris |
#### Sepcial case: multiple choice "checkboxes" ####
As a special case, enum arrays with `"uniqueItems": true` can be represented as multiple columns,
with one column per choice. The choices are denoted as the last `PATH` component, the column type
must be `MULTIPLE_CHOICE`.
Stored data is denoted as an "x" character in the respective cell, empty cells denote that the item
was not selected. Additionally, the implementation also allows `TRUE` or `1` for selected items,
and `FALSE`, `0` or cells with only whitespace characters for deselected items:
| `COL_TYPE` | `MULTIPLE_CHOICE` | `MULTIPLE_CHOICE` | `MULTIPLE_CHOICE` |
| `PATH` | `skills` | `skills` | `skills` |
| `PATH` | `Planning` | `Communication` | `Evaluation` |
| `IGNORE` | skills.Planning | skills.Communication | skills.Evaluation |
|------------|-------------------|----------------------|-------------------|
| | x | | X |
| | `" "` | `TRUE` | `FALSE` |
| | 0 | x | 1 |
These rows correspond to:
1. Planning, Evaluation
2. Communication
3. Communication, Evaluation
## Current limitations ##
The current implementation still lacks the following:
......
......@@ -267,6 +267,7 @@ def test_model_with_indirect_reference():
foreign_keys={"Wrapper": ["Training.name", "Training.url"]},
outfile=None)
def test_model_with_multiple_choice():
_compare_generated_to_known_good(
schema_file=rfp("data/multiple_choice_schema.json"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment