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

Allow saving of arrays and primitives in JSON column #13542

Open
1 task done
CSLTech opened this issue Apr 22, 2024 · 2 comments
Open
1 task done

Allow saving of arrays and primitives in JSON column #13542

CSLTech opened this issue Apr 22, 2024 · 2 comments
Labels
avalanche OSS team bb-components enhancement New feature or request forms frontend validation Relating to validation/verification/constraints

Comments

@CSLTech
Copy link
Contributor

CSLTech commented Apr 22, 2024

Checklist

  • I have searched budibase discussions and github issues to check if my issue already exists

Describe the bug
When trying to save a string in a JSON field, the API rejects it instead of saving the string as JSON. If the input to a JSON field is a string, the API shouldn't try to parse it and instead just save it as a string. Database JSON fields accept strings as inputs and is a typical use case to store data from arbitrary types.

To Reproduce
Steps to reproduce the behavior:

  1. Add a table with a JSON field
  2. Add a form that includes this JSON field using a component that would allow you to populate a string
  3. Try to save a string instead of JSON
  4. Error

Expected behavior
The string should be saved as-is

@CSLTech CSLTech added the bug Something isn't working label Apr 22, 2024
Copy link

linear bot commented Apr 22, 2024

@ConorWebb96 ConorWebb96 added frontend avalanche OSS team bb-components forms validation Relating to validation/verification/constraints labels May 8, 2024 — with Linear
Copy link
Contributor

This seems valid, the field also doesn't seem to accept arrays wether its empty or otherwise.

The only type i got to work with this field were objects.

Screenshot 2024-05-08 at 13.36.35.png

Strings, arrays are all valid JSON but throw the error saying invalid and won't allow you to save the record.

Screenshot 2024-05-08 at 13.27.24.png

@ConorWebb96 ConorWebb96 removed their assignment May 8, 2024
@shogunpurple shogunpurple removed the bug Something isn't working label May 8, 2024
@shogunpurple shogunpurple added the enhancement New feature or request label May 8, 2024 — with Linear
@shogunpurple shogunpurple changed the title Unable to save text in JSON field Allow saving of arrays and primitives in JSON column May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
avalanche OSS team bb-components enhancement New feature or request forms frontend validation Relating to validation/verification/constraints
Projects
None yet
Development

No branches or pull requests

3 participants