admin icon indicating copy to clipboard operation
admin copied to clipboard

Do not rely on specific JSON structure

Open angelo-v opened this issue 6 years ago • 2 comments

Expected behaviour

The admin tool can be used with any Hydra-conform API, that have the correct semantics.

Actual behaviour

The tool relies on specific JSON structures on some places, e.g collections need to have a property "hydra:member" on top level of the JSON structure. APIs with other namings or nesting in @graph fail. Same goes for "totalItems" and I suspect several other places.

angelo-v avatar Apr 08 '19 14:04 angelo-v

If I understand correctly, this has something to do with expansion / compaction, right?

https://www.w3.org/TR/json-ld11-api/

teohhanhui avatar Apr 08 '19 15:04 teohhanhui

Yes, a fix could look like what I did here: https://github.com/angelo-v/admin/commit/f3536daff20768a4a4aa81ce526bdf63e37ed098

But this is neither a complete fix, nor did I test it extensivly!

angelo-v avatar Apr 09 '19 07:04 angelo-v