common-workflow-language / common-workflow-language/schema_salad

No doc generated if documentRoot is abstract

Open
#554 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
86
Forks
64
Avg merge
19h 24m
Merged PRs (30d)
19

Description

Hi,

Using the following schema:

```yaml
- name: Parent
doc: |
Parent record
documentRoot: true
abstract: true
docChild:
- "#Child"
type: record
fields:
- name: id
jsonldPredicate:
_id: "#id"
type: int
doc: Parent ID

- name: Child
doc: |
Child record
type: record
extends: Parent
fields:
- name: id
jsonldPredicate:
_id: "#id"
type: int
doc: Child ID
```

it passes the validation with

```
(venv) kinow@ranma:~/Development/python/workspace/schema_salad$ schema-salad-tool schema_salad/tests/inherited-attributes.yml
/home/kinow/Development/python/workspace/schema_salad/venv/bin/schema-salad-tool Current version: 8.3.20220622140130
Schema `schema_salad/tests/inherited-attributes.yml` is valid
```

, however, because of `abstract: true` the generated documentation is empty. Removing the `abstract: true`, the documentation is generated successfully, as seen below.

```bash
(venv) kinow@ranma:~/Development/python/workspace/schema_salad$ schema-salad-tool --print-doc schema_salad/tests/inherited-attributes.yml > /tmp/test.html
```

![image](https://user-images.githubusercontent.com/304786/175427484-04f3e214-97d4-4f71-aebb-ad5b678f4ee9.png)

Is that per design? Or would it be OK to print the docs if the document root is abstract (I think it sounds reasonable to allow that)?

-Bruno

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.