Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Change media endpoint structure #247
As per the conversation on Slack this morning, this PR introduces a few changes to how media is handled by API.
Currently, media assets are stored in media collections, which consist of normal collections with a version, database and collection schema, accessible on the normal REST endpoints (i.e.
With this PR, the concept of media collections is abstracted from the public API. It removes the requirement for a collection schema, using a schema kept internally in API. At the moment it's hardcoded to store images (containing dimensions, size, mime type, etc.), but in the future we can look into making the schema adapt to the type of file being uploaded.
Even though that's abstracted from the end user, assets still need to be stored in collections. Assets POSTed to
This is how the endpoints look like for interacting with a media bucket called
Whenever there is a data collection with the same name as one of the media buckets, API throws an error detailing the name of the conflicting collection.
API base URL
This also fixes the issue described in #245 by introducing a
@mingard can you confirm whether this meets the requirements?
@jimlambie could you share your thoughts on the approach/implementation? Happy to make any required changes.
I propose that we add information about the media buckets to the