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

MakeCollection helper assumes the item is a Collection when it could be a CollectionRef #225

Open
markpbaggett opened this issue Jan 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@markpbaggett
Copy link
Member

The MakeCollection helper assumes the kwargs will have an items property. If the kwargs have no items, the helper generates a Collection with an empty items property: items=[].

Expected behaviour:

In the case where there is no items property, I think a CollectionRef should be added with no items prop.

Observed behaviour:

The helper returns a object like this:

    {
      "id": "https://raw.githubusercontent.com/markpbaggett/static_iiif/main/collections/primeros-libros.json",
      "type": "Collection",
      "label": {
        "en": [
          "Primeros Libros"
        ]
      },
      "items": []
    }

Potential bug location(s):

The helper always passes the kwargs to the Collection class:
https://github.com/iiif-prezi/iiif-prezi3/blob/main/iiif_prezi3/helpers/make_collection.py#L14-L16

It seems like it should check for items and either set to Collection (if present) or CollectionRef if not.

Any other comments:

@markpbaggett markpbaggett added the bug Something isn't working label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant