Skip to content

Releases: AustralianBioCommons/gen3schemadev

v2.6.1

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 03 Jul 07:00

Reverted

  • The allOf $ref wrapping introduced in v2.5.0 has been reverted (a971677). It was based on a misdiagnosis: Gen3's resolver merges a property's sibling keys over the referenced definition, so the normal sibling form {description: ..., $ref: ...} works fine. The actual cause of "No Description" in the data-dictionary viewer was description: null placeholders in the enum definitions of _definitions.yaml.

What changed

  • format_datetime emits the sibling form {description: ..., $ref: _definitions.yaml#/datetime} — descriptions are still preserved (unlike ≤2.4.0, which silently dropped them), just without the allOf wrapper.
  • The project.yaml and program.yaml templates are back to their 2.4.0 sibling-$ref form.
  • The fix-refs CLI command is removed — do not use it from 2.5.0/2.6.0.

What is kept

  • The description: null warning from v2.6.0 stays in validate: it scans the whole dictionary before resolution and lists every offending definition by file and path (e.g. _definitions.yaml: enum_yes_no.description). Removing those null keys is the actual fix for missing descriptions in the viewer.
  • validate remains tolerant of allOf/anyOf/oneOf-wrapped refs.

If you already ran fix-refs on a dictionary

No action needed: the wrapped form is valid JSON Schema and validate continues to accept it. You may revert the wrapping in your dictionary if you prefer the conventional sibling style, but it is not required.

Full Changelog: v2.6.0...v2.6.1

v2.6.0

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 03 Jul 02:23

Warning

The allOf $ref wrapping introduced in v2.5.0 was based on a misdiagnosis and has been reverted in v2.6.1. Do not use the fix-refs command from this release. The real cause of missing descriptions in the data-dictionary viewer is description: null placeholders in _definitions.yaml — the null-description warning (kept in v2.6.1) diagnoses it.

Features

  • Warn about description: null placeholders in validate and fix-refs (f571c79)

The Gen3 metaschema requires description to be a string, but generated shared definitions often carry description: null placeholders. A direct $ref masks the null during resolution (the referencing property's own description merges over it), while a bare or allOf-wrapped ref — including refs wrapped by v2.5.0's fix-refs — exposes it: metaschema validation then fails on a resolved node schema, far from the offending definition, and aborts on the first hit.

Both commands now scan the whole dictionary up front and print a single warning block listing every offender by file and dotted path (e.g. _definitions.yaml: enum_yes_no.description), so the root cause is named before the confusing downstream failure.

Details

  • validate runs the scan on the bundled schemas before rule validation and resolution.
  • fix-refs runs it after its summary (also in --dry-run), since wrapping is what exposes the nulls.
  • Warning only — dictionaries where masked nulls currently pass keep passing; the metaschema stage remains the enforcer. The suggested remediation is to remove the null description keys from the shared definitions: removing adds no shared description, so nothing leaks onto referencing properties.

Full Changelog: v2.5.0...v2.6.0

v2.5.0

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 03 Jul 02:01

Warning

The allOf $ref wrapping introduced in v2.5.0 was based on a misdiagnosis and has been reverted in v2.6.1. Do not use the fix-refs command from this release. The real cause of missing descriptions in the data-dictionary viewer is description: null placeholders in _definitions.yaml — the null-description warning (kept in v2.6.1) diagnoses it.

Features

  • Preserve $ref sibling annotations via allOf wrapping and add fix-refs command (1f805ad)

Gen3 resolves data dictionaries with JSON Schema draft-04 semantics, where any keyword sitting as a direct sibling of $ref is ignored during resolution. Properties written as {description: ..., $ref: ...} therefore lost their description/termDef/term in dictionaryutils, and the data-dictionary viewer showed "No Description". This release keeps those annotations by moving the $ref into an allOf list, with the annotations as siblings of allOf.

Details

  • New refs module — single source of truth for the transform. Idempotent; never touches bare refs, refs already inside allOf/anyOf/oneOf, the properties: {$ref: ...} merge construct, or _definitions.yaml/_terms.yaml/_settings.yaml.
  • Generator fixformat_datetime no longer drops the property description when emitting the _definitions.yaml#/datetime ref; annotations are preserved beside allOf.
  • New CLI commandgen3schemadev fix-refs -y <dir> [--dry-run] rewrites an existing dictionary in place (recursive) with a per-file, per-property report of what was wrapped and what was skipped and why.
  • Rule validatorprops_must_have_type now recognises refs wrapped in allOf/anyOf/oneOf, so fixed properties are not flagged as missing type/enum. Legacy top-level sibling refs still validate as before.
  • Shipped templates — sibling-$ref properties in project.yaml (id, programs) and program.yaml (id) rewritten to the allOf form.

Notes for downstream consumers

  • Resolved-schema shape changes for wrapped properties: the referenced definition content now nests under allOf[0] after resolution (gen3-validator), instead of being merged flat.
  • After updating a deployed dictionary, the compiled dictionary must be rebuilt and the portal cache refreshed before descriptions appear in the UI.

Full Changelog: v2.4.0...v2.5.0

v2.4.0

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 17 Jun 00:57

What's Changed

Features

  • Broaden supported Python versions from 3.12-only to 3.9.5+ (now 3.9, 3.10, 3.11, 3.12) (a6658bf)

Other

  • Add a CI matrix that builds and runs the test suite on Python 3.9, 3.10, 3.11, and 3.12
  • Re-resolve and lock dependencies across the wider Python range

Full Changelog: v2.3.6...v2.4.0

v2.3.6

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 20 Apr 05:15

What's Changed

fix: preserve user-defined data_* properties on data_file nodes (#67)

Bug: construct_props in src/gen3schemadev/converter.py unconditionally overwrote data_category, data_format, data_type, and core_metadata_collections on any data_file node, silently discarding enum values a user had declared in input.yaml. Declaring, e.g., data_format with enums: [csv, txt] had no effect — the generated schema always received the hardcoded placeholders ['data_format_1', 'data_format_2', 'data_format_3'].

Fix: Switched those four assignments from dict[key] = to dict.setdefault(key, ...) so the hardcoded placeholders are only injected when the user has not already defined the property. User-authored definitions now survive end-to-end through gen3schemadev generate. Existing projects that rely on the default placeholders are unaffected.

Example — now works as expected:

- name: lipidomics_file
  category: data_file
  properties:
    - name: data_format
      type: enum
      description: File format for lipidomics output
      enums: [csv, txt]

Tests: Added 6 regression tests in tests/test_converter.py plus a new fixture tests/input_example_file_props.yml covering preservation of each of the three reported properties, preservation of core_metadata_collections, the default-injection fallback path, and an end-to-end populate_template round-trip. Full suite: 99/99 passing.

Full Changelog: v2.3.5...v2.3.6

v2.3.5

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 23 Mar 22:55

What's Changed

Features

  • Project foreign key link definitions (#66): Modified create_link_prop to use to_one_project and to_many_project definitions when linking to project nodes, as project uses foreign_key_project (id/code) instead of the standard foreign_key (id/submitter_id). Includes comprehensive tests covering all multiplicity scenarios for project links.
  • Project schema code validation (#65): Added a new RuleValidator method to enforce that project schemas must include code in their required properties list, as Gen3 uses code as the unique project identifier. Includes comprehensive tests covering pass, fail, and skip scenarios for non-project schemas.

Chores

  • Bump version to 2.3.5

v2.3.4

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 23 Mar 04:25

What's Changed

Improvements

  • Upgraded gen3-validator dependency to 2.x
  • Updated version to 2.3.4

Documentation

  • Updated README.md

v2.3.3

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 24 Oct 00:45
69d1d06

What's Changed

Full Changelog: v2.3.2...v2.3.3

v2.3.2

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 24 Oct 00:24
801c3c5

What's Changed

Full Changelog: v2.3.1...v2.3.2

v2.3.1

Choose a tag to compare

@JoshuaHarris391 JoshuaHarris391 released this 23 Oct 23:27

Full Changelog: v2.3.0...v2.3.1

  • Fix added, rule validator now checks that data_type, data_category, and data_format are props in a data_file node