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

Allow extra fields on a service. #204

Open
glenrobson opened this issue Nov 24, 2024 · 0 comments
Open

Allow extra fields on a service. #204

glenrobson opened this issue Nov 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@glenrobson
Copy link
Contributor

It is possible to add the full info.json to a Image server and this is recommended in the thumbnail recipe to enable quick retrieval of thumbnails.

Expected behaviour:

When you pass in a info.json to a service:

service = infoJson
print (service)
service["@type"] = "ImageService2"
body.service = [service]
print (body.service[0])

The first print gives the full info.json

{'tiles': [{'scaleFactors': [32, 16, 8, 4, 2, 1], 'width': 1024, 'height': 1024}], 'protocol': 'http://iiif.io/api/image', 'sizes': [{'width': 126, 'height': 95}, {'width': 252, 'height': 189}, {'width': 504, 'height': 378}, {'width': 1008, 'height': 756}, {'width': 2016, 'height': 1512}, {'width': 4032, 'height': 3024}], 'profile': 'http://iiif.io/api/image/2/level0.json', 'width': 4032, '@id': 'https://iiif-test.github.io/test2/images/IMG_5969', '@context': 'http://iiif.io/api/image/2/context.json', 'height': 3024}

Observed behaviour:

The second print statement gives the fields that are retained in the service:

id=Id(__root__=AnyUrl('https://iiif-test.github.io/test2/images/IMG_5969', scheme='https', host='iiif-test.github.io', tld='io', host_type='domain', path='/test2/images/IMG_5969')) type='ImageService2' profile='http://iiif.io/api/image/2/level0.json' service=None

Only the Id, type and profile are retained.

Potential bug location(s):

Easiest fix is to add:

class Config:
        extra = Extra.allow

To serviceItem and serviceItem1

@glenrobson glenrobson added the bug Something isn't working label Nov 24, 2024
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