From 206a6220cc62f99d8e9de8a09a4a658b608304d0 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 5 May 2024 15:02:59 +0200 Subject: [PATCH] Add CoreValidationSchema online documentation plus validation module docs --- docs/docs/reference/core.md | 1 + docs/docs/reference/validation.md | 13 +++++++++++++ docs/docs/reference/validationschema.md | 12 ++++++++++++ docs/docs/reference/validationsingle.md | 4 ++-- 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 docs/docs/reference/validation.md create mode 100644 docs/docs/reference/validationschema.md diff --git a/docs/docs/reference/core.md b/docs/docs/reference/core.md index c056abe..62c3127 100644 --- a/docs/docs/reference/core.md +++ b/docs/docs/reference/core.md @@ -25,6 +25,7 @@ Use these to access CORE's modules. - [`sms`](/reference/sms) - [`erm`](/reference/erm) (formerly `edl`) - [`storage`](/reference/storage) +- [`validation`](/reference/validation) ## Constants ### *Array[String]* modules = *[ "logger", "misc", "sms", "logui", "erm", "storage" ]* diff --git a/docs/docs/reference/validation.md b/docs/docs/reference/validation.md new file mode 100644 index 0000000..7de22f7 --- /dev/null +++ b/docs/docs/reference/validation.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 10 +description: Allows for data validation. +--- + +# `Validation (module)` + + +## Functions +### *CoreValidationSingle* get_single(*anything you like* data, *Node* parent) +Returns a new [`CoreValidationSingle`](/reference/validationsingle). +### *CoreValidationSchema* get_schema(*Dictionary* schema, *Node* parent) +Returns a new [`CoreValidationSchema`](/reference/validationschema). diff --git a/docs/docs/reference/validationschema.md b/docs/docs/reference/validationschema.md new file mode 100644 index 0000000..42c83c0 --- /dev/null +++ b/docs/docs/reference/validationschema.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 12 +description: Used for validating multiple CoreValidationSingles. +--- + +# `CoreValidationSchema` +Validates multiple `CoreValidationSingle`s at once. + + +## Functions +### *Array[String]* evaluate() +Evaluates all singles and returns the names of all failed singles in an array. diff --git a/docs/docs/reference/validationsingle.md b/docs/docs/reference/validationsingle.md index 1356a62..ad7a3cf 100644 --- a/docs/docs/reference/validationsingle.md +++ b/docs/docs/reference/validationsingle.md @@ -1,10 +1,10 @@ --- -sidebar_position: 10 +sidebar_position: 11 description: Used for validating data. --- # `CoreValidationSingle` -Provides the default configuration for the CORE Framework. +Validates some data against a set of predefined rules. ## Variables