api-platform / admin

A beautiful and fully-featured administration interface builder for hypermedia APIs
https://api-platform.com/docs/admin/
MIT License
482 stars 131 forks source link

Do not rely on specific JSON structure #168

Open angelo-v opened 5 years ago

angelo-v commented 5 years ago

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.

teohhanhui commented 5 years ago

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

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

angelo-v commented 5 years ago

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!