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

AllOf references not being displayed #376

Open
M-casado opened this issue Dec 3, 2021 · 0 comments
Open

AllOf references not being displayed #376

M-casado opened this issue Dec 3, 2021 · 0 comments
Labels

Comments

@M-casado
Copy link

M-casado commented Dec 3, 2021

Expected Behaviour

Inherited nodes within allOf clauses would be displayed within the markdown.

Actual Behaviour

Nodes inherited through allOf clauses from common definitions are not correctly linked within the markdowns of an object.

Steps to Reproduce

  1. Have a schema with common definitions (in my example EGA.common-definitions.json).
  2. Reference definitions from that schema in another file (in my example EGA.ArrayAssay.json - specifically at this lines) or same file.
  3. Generate markdown documents with jsonschema2md through the CLI:
jsonschema2md -d ./ -o ./markdown -e "json"
  1. Check markdown of the referencing object (i.e. EGA.ArrayAssay.json) and click on the node (in my example object_id) right above the referenced object (object_id). In my example, the reference of "allOf" to object_id is missing.

Platform and Version

  • Operating System: Windows 10 with Windows Subsystem for Linux v2
  • node.js: v16.13.0
  • jsonschema2md: 6.1.4

Sample Code that illustrates the problem

Within the object_id object one can find the following markdown:

# Object's IDs block Schema

```txt
https://github.com/EbiEga/ega-metadata-schema/tree/main/schemas/EGA.ArrayAssay.json#/properties/object_id
```

Node containing the main identifiers of the object (e.g. alias, center_name...), inherited from the common definitions. #! We extend the core object (object_core_id) by adding a pattern check based on this schema's nature: an ArrayAssay (by using EGA-ArrayAssay-id-pattern)

| Abstract            | Extensible | Status         | Identifiable            | Custom Properties | Additional Properties | Access Restrictions | Defined In                                                                |
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------ |
| Can be instantiated | No         | Unknown status | Unknown identifiability | Forbidden         | Allowed               | none                | [EGA.ArrayAssay.json*](../out/EGA.ArrayAssay.json "open original schema") |

## object_id Type

`object` ([Object's IDs block](ega-properties-objects-ids-block.md))

all of

*   any of

    *   [Check core IDs: combination of Alias and Center name](ega-2-definitions-core-identifiers-of-an-object-anyof-check-core-ids-combination-of-alias-and-center-name.md "check type definition")

    *   [Check core IDs: EGA accession ID](ega-2-definitions-core-identifiers-of-an-object-anyof-check-core-ids-ega-accession-id.md "check type definition")

    *   [Check core IDs: external accessions](ega-2-definitions-core-identifiers-of-an-object-anyof-check-core-ids-external-accessions.md "check type definition")

*   [Check that ArrayAssay EGA ID (EGAA) is correct](ega-properties-objects-ids-block-allof-check-that-arrayassay-ega-id-egaa-is-correct.md "check type definition")

As one can see, the "all of" part is erroneous, the references are the following (see lines) within the schemas:

"allOf": [
  {
    "title": "Inherited object_core_id object",
    "$ref": "https://github.com/EbiEga/ega-metadata-schema/tree/main/schemas/EGA.common-definitions.json#/definitions/object_core_id"
  },
  {
    "title": "Check that ArrayAssay EGA ID (EGAA) is correct",
    "properties": {
      "ega_accession": {
        "$ref": "https://github.com/EbiEga/ega-metadata-schema/tree/main/schemas/EGA.common-definitions.json#/definitions/EGA-ArrayAssay-id-pattern"
      }
    }
  }
]        

I would expect the "AllOf" to include a reference to the object_core_ids that is indeed displayed within the markdowns, just not linked to the nodes that reference it. Instead, the reference that appears is the object_id right above it, and no reference of object_core_ids can be seen within it.

It could be that the way I structured my reference with "allOf" is erroneous, but so far all validators I have used work properly with it.

@trieloff trieloff added the bug label Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants