@lanetix/record-type-validator

Schema validation for Lanetix Record Types

Usage no npm install needed!

<script type="module">
  import lanetixRecordTypeValidator from 'https://cdn.skypack.dev/@lanetix/record-type-validator';
</script>

README

record-type-validator

Schema validation for Lanetix Record Types

usage

import validate from '@lanetix/record-type-validator'

validate(model)

options

greedy

is-my-json-valid Documentation

import validate from '@lanetix/record-type-validator'

const validationErrors = validate({ property: 'value' }, { greedy: true })

The validate function will return an array of validation errors or null if there were none.

verbose

is-my-json-valid Documentation

import validate from '@lanetix/record-type-validator'

const validationErrors = validate({ property: 'value' }, { verbose: true })

The validate function will return an array of validation errors or null if there were none.

required

Override the required fields property for schema validation

import validate from '@lanetix/record-type-validator'

validate({ property: 'value' }, { required: [] })

schema

is-my-json-valid Documentation

import validate from '@lanetix/record-type-validator'

validate({ property: 'value' }, { schema: { ... }})