biolink / biolinkml

DEPRECATED: replaced by linkml
https://github.com/linkml/linkml
Creative Commons Zero v1.0 Universal
23 stars 12 forks source link

fix generated json-schema to properly include refs #129

Closed cmungall closed 4 years ago

cmungall commented 4 years ago
id: http://example.org/sample/types

prefixes:
  biolinkml: https://w3id.org/biolink/biolinkml/

imports:
  - biolinkml:types

types:
  yearCount:
    base: int
    uri: xsd:int

classes:
  c:
    slots:
      - id
      - age in years
      - scores
      - has prop
      - has d
      - has ds
      - children
      - parent
  d:
    slots:
      - id

slots:

  id:
    identifier: true

  scores:
    range: float
    multivalued: true
  has prop:
    range: boolean
  age in years:
    range: yearCount
  has d:
    range: d
    multivalued: false
    inlined: true
  has ds:
    range: d
    multivalued: true
    inlined: true
  children:
    range: c
    multivalued: true
  parent:
    range: c
    multivalued: false

current json output:

      "C": {
         "description": "",
         "properties": {
            "age_in_years": {
               "type": "string"
            },
            "children": {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            "has_d": {
               "type": "string"
            },
            "has_ds": {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            "has_prop": {
               "type": "string"
            },
            "id": {
               "required": true,
               "type": "string"
            },
            "parent": {
               "type": "string"
            },
            "scores": {
               "items": {
                  "type": "string"
               },
               "type": "array"
            }
         },
         "title": "C",
         "type": "object"

There should be a $ref for any inlined reference to D