The Wayback Machine - https://web.archive.org/web/20200909200310/https://github.com/topics/schema-validation
Skip to content
#

schema-validation

Here are 73 public repositories matching this topic...

uinz
uinz commented Jul 5, 2020

default

const V = require('fastest-validator');

const v = new V();

const schema = {
  tuple: {
    type: 'tuple',
    empty: false,
    items: [{ type: 'string', default: '1' }],
  },
};

const data = { tuple: [] };
console.log(v.validate(data, schema));
console.log(data);
[
  {
    type: 'tupleEmpty',
    message: "The 'tuple' field must not be an empty
felixbr
felixbr commented Sep 3, 2020

In our codebase I observed that the generated files are often recompiled without explicitly cleaning them or changing the schema. This isn't a big deal for small schemas but in our case it's over 400 files that are being recompiled and takes several seconds.

I don't have a repro-case yet but it should be fairly straight forward. I can imagine using one of the test/example projects and checking

Improve this page

Add a description, image, and links to the schema-validation topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the schema-validation topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.