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(schema): list root node needs a comments object (DEV-61) #122

Merged
merged 4 commits into from Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions docs/dsp-tools-create.md
Expand Up @@ -181,7 +181,8 @@ A node of a list may have the following elements:
- _labels_: Label with language tags in the form `{ "<lang>": "<label>", "<lang>": "<label>", ... }`. The `labels`
element is mandatory. It needs to specify at least one language. Currently, "de", "en", "fr" and "it" are supported.
- _comments_: Comment with language tags in the form `{ "<lang>": "<comment>", "<lang>": "<comment>", ... }`.
The `comments` element is optional. Currently, "de", "en", "fr" and "it" are supported.
Currently, "de", "en", "fr" and "it" are supported. The `comments` element is mandatory for the root node of the list.
For all other nodes, it is optional. If not used, the element should be omitted.
- _nodes_: Array of sub-nodes. The `nodes` element is optional and can be omitted in case of a flat list.

Example of a list:
Expand Down Expand Up @@ -309,6 +310,10 @@ file(s) can be directly referenced inside the list definition by defining it as
"en": "List from an Excel file",
"de": "Liste von einer Excel-Datei"
},
"comments": {
"en": "This is just an example.",
"fr": "C'est un example."
},
"nodes": {
"folder": "excel-lists"
}
Expand All @@ -319,7 +324,7 @@ The nodes section must contain the field:

- _folder_: Path to the folder where the Excel files are stored

Further details to this functionality can be read
Further details to this functionality can be found
[here](dsp-tools-excel#create-a-list-from-one-or-several-excel-files).

The `lists` element is optional. If not used, it should be omitted.
Expand Down Expand Up @@ -355,7 +360,7 @@ Example:
}
```

The `groups` element is optional. It is currently not recommended using it.
The `groups` element is optional. If not used, it should be omitted. It is currently not recommended using it.

### Users

Expand Down Expand Up @@ -401,7 +406,7 @@ Example:
}
```

The `users` element is optional.
The `users` element is optional. If not used, it should be omitted.

### Ontologies

Expand Down
8 changes: 7 additions & 1 deletion knora/dsplib/schemas/ontology.json
Expand Up @@ -500,7 +500,13 @@
"lists": {
"type": "array",
"items": {
"$ref": "#/definitions/node"
"$ref": "#/definitions/node",
"comments": {
"$ref": "#/definitions/comment"
},
"required": [
"comments"
]
}
},
"ontologies": {
Expand Down
5 changes: 1 addition & 4 deletions testdata/test-onto.json
Expand Up @@ -39,10 +39,7 @@
{
"name": "b",
"labels": {
"en": "b_label"
},
"comments": {
"en": "no comment"
"en": "b_label with no comment"
},
"nodes": [
{
Expand Down