Open saleemalharir1 opened 2 months ago
I am seeing a regression to his now that processing is an optional parameter.
I suggest something like this:
# Build the payload
payload = {
"resource_name": resource_name,
"resource_title": resource_title,
"owner_org": owner_org,
"resource_url": resource_url,
"file_type": file_type,
"notes": notes,
"extras": extras or {},
"mapping": mapping or {},
}
if processing:
payload['processing'] = processing.to_dict()
The problem with any resolution to this in the client is that processing
is being validated against the file_type
-specific model in the API. I'm opening a ticket for this in the scidx-api
repo, since that's where the handling comes out.
Hi Philip! This has been resolved in the branch, the new version looks like this: payload = { "resource_name": resource_name, "resource_title": resource_title, "owner_org": owner_org, "resource_url": resource_url, "notes": notes, "extras": extras or {}, "mapping": mapping or {}, }
if file_type:
payload["file_type"] = file_type
if processing:
payload["processing"] = processing.to_dict()
By the end of today I will send the merge request of the actual branch I am working on.