schema_salad icon indicating copy to clipboard operation
schema_salad copied to clipboard

No doc generated if documentRoot is abstract

Open kinow opened this issue 2 years ago • 0 comments

Hi,

Using the following schema:

- 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.

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

image

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

kinow avatar Jun 23 '22 22:06 kinow