Skip to content

Accessibility library instances store payment_models as dicts instead of PaymentModelType objects #94

@gefleury

Description

@gefleury

Environment: openminds 0.5.1, Python 3.12

All Accessibility library instances (e.g. Accessibility.direct_virtual_open_access) define their properties as dicts {"@id": "..."} instead of typed objects. See openminds/v5/core/miscellaneous/accessibility.py

Minimal example

import openminds.latest
from openminds import Collection
from openminds.latest.core.miscellaneous.accessibility import Accessibility
from pathlib import Path

# Minimal collection
c = Collection()
c.add(Accessibility.direct_virtual_open_access)

# Validate
display(c.validate())

#Save
out_dir = Path("../test_accessibility")
out_dir.mkdir(exist_ok=True)
c.save(out_dir, individual_files=True, group_by_schema=True)

# Reload from disk — raises KeyError
c2 = Collection()
c2.load(out_dir, version="latest")

In this example, the referenced PaymentModelType instance is never added to the collection when saving, which causes a KeyError in Collection.load() .

Note: the same pattern likely affects other properties (channel, eligibility, form, process) of Accessibility library instances

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions