-
Notifications
You must be signed in to change notification settings - Fork 80
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
docs: add dataset schema validation #1304
Conversation
@@ -118,7 +118,7 @@ The template above defines the configuration for the default dataset output view | |||
|
|||
The default behavior of the Output tab UI table is to display all fields from `transformation.fields` in the specified order. You can customize the display properties for specific formats or column labels if needed. | |||
|
|||
![Output tab UI](./images/output-schema-example.png) | |||
![Output tab UI](../images/output-schema-example.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the image is used also on some other page so I have left it in the original folder and just change the path, but it can be done either way (change the folder and path for the othe page)
@@ -41,12 +41,22 @@ Currently, the monitoring option offers the following features: | |||
|
|||
### Alert configuration | |||
|
|||
When you set up an alert, you have two choices for how you want the metrics to be evaluated. And depending on your choices, the alerting system will behave differently: | |||
When you set up an alert, you have four choices for how you want the metrics to be evaluated. And depending on your choices, the alerting system will behave differently: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a part of the validation, new monitoring possibilities arised, I have added them here
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes needed, but otherwise I think this is hopefully good enough for most users :)
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Show resolved
Hide resolved
…chema/validation.md Co-authored-by: Jaroslav Hejlek <[email protected]>
…chema/validation.md Co-authored-by: Jaroslav Hejlek <[email protected]>
…chema/validation.md Co-authored-by: Jaroslav Hejlek <[email protected]>
…chema/validation.md Co-authored-by: Jaroslav Hejlek <[email protected]>
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
|
||
:::info | ||
|
||
The schema defines a single item in the dataset. Be careful not to define the schema as an array, it always needs to be a schema of an object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gippy, does user get an error when this happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not actually 100% sure. I think you could theoretically set the top level type of the schema to array. Will test it tomorrow. If it's possible then we will try to add some check to build so that the creator cannot do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y, let's throw an error as early as possible so ideally in the build. Later it's too late.
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
|
||
## Dataset validation | ||
|
||
When you define a schema of your default dataset, the schema is then always used when you insert data into the dataset to perform validation (we use [AJV](https://ajv.js.org/)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to consider - do we want to mention we currently use AJV? Perhaps AJV contains some JSON schema extensions, and if we replace them, we could change the expected behavior. Or is this not the thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to mention it, because the creators can then look up the validation output and what it means. I do not think AJV contains any additions to JSON schema.
|
||
**If the data you attempt to store in the dataset is invalid** (meaning any of the items received by the API fails the validation), **the whole request is discarded** and the API will return a response with status code 400 and the following JSON response: | ||
|
||
```json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the API docs with this and link them to this documentation. It's important to have it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, but I agree with Mara's comments
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Marek Trunkát <[email protected]>
…chema/validation.md Co-authored-by: Marek Trunkát <[email protected]>
…chema/validation.md Co-authored-by: Marek Trunkát <[email protected]>
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go, spotted two things
- Double occurence of
separate
- Typo
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/dataset_schema/validation.md
Outdated
Show resolved
Hide resolved
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
…chema/validation.md Co-authored-by: Michał Olender <[email protected]>
resolves #1295 : adding documentation for dataset validation plus updating related part in monitoring