# next-core-validation

Augmented.js Next Core - Validation Framework

# API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [ValidationFramework](#validationframework)
    -   [supportsValidation](#supportsvalidation)
    -   [registerSchema](#registerschema)
        -   [Parameters](#parameters)
    -   [getSchema](#getschema)
        -   [Parameters](#parameters-1)
    -   [getSchemas](#getschemas)
    -   [clearSchemas](#clearschemas)
    -   [validate](#validate)
        -   [Parameters](#parameters-2)
    -   [getValidationMessages](#getvalidationmessages)
    -   [generateSchema](#generateschema)
        -   [Parameters](#parameters-3)
-   [URI_TEMPLATE_GLOBAL_MODIFIERS](#uri_template_global_modifiers)
-   [SchemaGenerator](#schemagenerator)
    -   [Parameters](#parameters-4)

## ValidationFramework

Augmented.ValidationFramework -
The Validation Framework Base Wrapper Class.
Provides abstraction for base validation build-in library

### supportsValidation

Returns if the framework supports validation

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns true if the framework supports validation

### registerSchema

Registers a schema to the Framework

#### Parameters

-   `identity` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The identity of the schema
-   `schema` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The JSON schema

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns true on success

### getSchema

Gets a schema

#### Parameters

-   `identity` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The identity of the schema

Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The JSON schema

### getSchemas

Gets all schemas

Returns **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** all JSON schemas

### clearSchemas

Clears all schemas

### validate

Validates data via a schema

#### Parameters

-   `data` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The data to validate
-   `schema` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The JSON schema

Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Returns the validation object

### getValidationMessages

Validates data via a schema

Returns **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Returns the validation messages

### generateSchema

Validates data via a schema

#### Parameters

-   `model` **(Augmented.Model | [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** The model generate from

Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Returns the schema

## URI_TEMPLATE_GLOBAL_MODIFIERS

-   **See: <https://github.com/geraintluff/uri-templates>
    but with all the de-substitution stuff removed
    **

## SchemaGenerator

<p>Augmented.Utility.SchemaGenerator<br/>

Genrate a schema from a set of data</p>

### Parameters

-   `data` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** a dataset to produce a schema from
-   `title`   (optional, default `"model"`)
-   `description`   (optional, default `"Generated Schema"`)
