Cannot relate attachement through datasetId field in POST request of attachments v4

Open
#2,703 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api, backend

Research direction

Start by tracing the POST /api/v4/attachments entry point and its request validation to see why datasetId is rejected. Then follow attachment creation and dataset relation handling; done means a request containing datasetId is accepted and the attachment is associated with the existing dataset rather than created without a relation.

Written by the indexing model from the issue text.

Description

bug

Summary

When trying to attach an attachment to an existing dataset, one cannot indicate the dataset to which the attachment belongs. It seemed possible in v3.

Steps to Reproduce

Post an attachment using /api/v4/attachments

Current Behaviour

returns {
"message": [
"property datasetId should not exist"
],
"error": "Bad Request",
"statusCode": 400
}
After removing this field, it returns a 201 so the attachment was created but ends in nirvana.

Dominant language
TypeScript
Stars
27
Forks
37
Avg merge
17h 32m
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SciCatProject/backend

All issues in SciCatProject/backend

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.