ropensci / ckanr

R client for the CKAN API
https://docs.ropensci.org/ckanr
Other
99 stars 38 forks source link

Support updating of resource extra fields w/o including a path parameter #175

Closed nicholsn closed 3 years ago

nicholsn commented 3 years ago

Description

This PR makes the path parameter to resource_update optional in order to support updating of resource extra fields.

While resource_patch ckan api allows for modifying the value of a given resource extra, it does not allow for deleting an extra that is no longer needed. (note that extras are not supported in the ckanr::resource_patch)

The current behavior only supports resource_update when a the file/url is being uploaded which may require an unnecessary download and reupload of a file just to remove a metadata field.

Todos

Related Issue

Example

# update an existing resource with an extra
id <- resource_update(id$id, extras = list(foo='bar'))

# purge all extras
resource_update(id)
sckott commented 3 years ago

looks good