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

API returns unset array fields as empty arrays #1401

Open
jl-wynen opened this issue Aug 27, 2024 · 1 comment
Open

API returns unset array fields as empty arrays #1401

jl-wynen opened this issue Aug 27, 2024 · 1 comment

Comments

@jl-wynen
Copy link
Contributor

Fields with an array type are always returned as arrays. Even when they have not been set. This causes conflicts between raw and derived datasets. E.g., downloading a raw dataset returns

inputDatasets = []
usedSoftware = []

These fields are not allowed for raw datasets. So this can cause validation errors in clients. See, e.g., SciCatProject/scitacean#226.

Similarly, other array fields such as relationships and sharedWith are returned as [] even if they have not been set during upload.

Is this intended behaviour? Should clients treat empty arrays equivalently to absent / none fields?

@bpedersen2
Copy link
Contributor

Should probably get fixed in the ds type unification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants