Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't display foreign keys in data output #224

Closed
1 task
MRichards99 opened this issue Apr 26, 2021 · 3 comments
Closed
1 task

Don't display foreign keys in data output #224

MRichards99 opened this issue Apr 26, 2021 · 3 comments
Labels
db backend Issues relating to the DB backend refactor wontfix This will not be worked on

Comments

@MRichards99
Copy link
Collaborator

Description:
In the DB backend, foreign keys are returned in the response body of a GET request. Example for http://{{datagateway-api}}/datasets?limit=1&include="sample":

[
    {
        "id": 1,
        "complete": false,
        "createId": "user",
        "createTime": "2011-01-29 06:19:43",
        "description": "Long bed after near eye wrong. Develop Mr everybody common.\nDemocrat until stock southern song. Close face test which summer.",
        "doi": "0-467-23440-X",
        "endDate": null,
        "location": "/million/young.mp3",
        "modId": "user",
        "modTime": "2008-10-15 12:05:09",
        "name": "DATASET 1",
        "startDate": "2000-05-07 00:00:00",
        "investigationID": 1,
        "sampleID": 1,
        "typeID": 1,
        "sample": {
            "id": 1,
            "createId": "user",
            "createTime": "2011-01-29 06:19:43",
            "modId": "user",
            "modTime": "2008-10-15 12:05:09",
            "name": "SAMPLE 6",
            "investigationID": 6,
            "sampleTypeID": 10
        }
    }
]

The foreign keys shouldn't be displayed on output as they're not displayed on the ICAT backend - this is part of the work for #213.

As a note, there could be some cases where the helper functions that fetch results from the database are used as an input into another function (updating data perhaps). The ICAT backend uses similar design, so a flag might be required to distinguish the two use cases (no foreign keys GETs and foreign keys for DB input). Not 100% sure on this, but something to keep in mind.

Acceptance criteria:

  • Foreign keys shouldn't be displayed GET, POST or PATCH requests involving entities that have relationships with other entities
@MRichards99 MRichards99 added refactor db backend Issues relating to the DB backend labels Apr 26, 2021
@MRichards99 MRichards99 self-assigned this May 13, 2021
@MRichards99
Copy link
Collaborator Author

Unassigning myself as this won't be tackled in the short term.

@MRichards99 MRichards99 removed their assignment Feb 23, 2022
@MRichards99 MRichards99 added the wontfix This will not be worked on label Mar 17, 2022
@MRichards99
Copy link
Collaborator Author

Adding the wontfix label to this issue - there's no plans to work on this issue for the time being and because the DB backend won't be used in production, this is a low priority, potentially high effort issue.

@MRichards99
Copy link
Collaborator Author

DB backend to be removed as per #489

@MRichards99 MRichards99 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db backend Issues relating to the DB backend refactor wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant