Skip to content

Tidy up schema to make null vs. empty list more intentional #438

@edeutsch

Description

@edeutsch

In the TRAPI 1.4 schema we have not been diligent about handling of nulls vs empty lists consistently. We should go through the schema and make everything tidy and consistent, or be intentional about what null vs [ ] means.

Cannot be null, but could be an empty list:

        logs:
          description: >-
            A list of LogEntry items, containing errors, warnings, debugging
            information, etc. List items MUST be in chronological order with
            earliest first. The most recent entry should be last. Its timestamp
            will be compared against the current time to see if there is
            still activity.
          type: array
          items:
            $ref: '#/components/schemas/LogEntry'
          nullable: false

Can be null or could be an empty list:

        results:
          description: >-
            List of all returned Result objects for the query posed.
            The list SHOULD NOT be assumed to be ordered. The 'score' property,
             if present, MAY be used to infer result rankings.
          type: array
          items:
            $ref: '#/components/schemas/Result'
          nullable: true

Can be null or, if a list, it must have at least one item:

        ids:
          type: array
          items:
            $ref: '#/components/schemas/CURIE'
          minItems: 1
          example: [OMIM:603903]
          description: CURIE identifier for this node
          nullable: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions