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

Schema Validation #29

Closed
yuval-hazaz opened this issue May 18, 2020 · 0 comments
Closed

Schema Validation #29

yuval-hazaz opened this issue May 18, 2020 · 0 comments
Assignees
Labels
type: enhancement New feature or request

Comments

@yuval-hazaz
Copy link
Member

yuval-hazaz commented May 18, 2020

When saving entity fields, or blocks, or pages we need to save a list of properties in a JSON field in the DB.
We should validate the JSON schema before we save it to the DB.
for example:
EntityField.Properties is a JSON field that holds the special properties for each dataType.
When data type is "Single Line Text" the properties should only include "Max Length"
When data type is "Whole Number" the properties should include "Min Value" and "Max value".

In order to do that we can use a JSON schema validation package

https://github.com/tdegrunt/jsonschema
https://github.com/ajv-validator/ajv
https://github.com/ebdrup/json-schema-benchmark

for each datatype we should have an hard-coded schema and use it both on the client side and server for validation and presentation.

@yuval-hazaz yuval-hazaz added the type: enhancement New feature or request label May 18, 2020
@iddan iddan closed this as completed May 31, 2020
mshidlov pushed a commit that referenced this issue May 10, 2022
A-Scratchy pushed a commit to A-Scratchy/amplication that referenced this issue Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants