How to use the uniforms-bridge-json-schema.JSONSchemaBridge function in uniforms-bridge-json-schema

To help you get started, we’ve selected a few uniforms-bridge-json-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vazco / uniforms / docs / examples / CustomFields / DisplayIfFieldSchema.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

export default new JSONSchemaBridge(schema, schemaValidator);
github vazco / uniforms / docs / examples / CustomFields / CycleFieldSchema.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

export default new JSONSchemaBridge(schema, schemaValidator);
github vazco / uniforms / docs / examples / Tutorial / GuestSchema2.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

const bridge = new JSONSchemaBridge(schema, schemaValidator);

export default bridge;
github react-page / react-page / packages / plugins / createPluginMaterialUi / src / utils / makeUniformsSchema.ts View on Github external
function makeUniformsSchema(
  jsonSchema: Omit, 'type'>
) {
  const fullSchema: JsonSchema = {
    type: 'object',
    ...jsonSchema,
  };
  return new JSONSchemaBridge(fullSchema, createValidator(fullSchema));
}
github vazco / uniforms / docs / examples / CustomFields / ImageFieldSchema.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

const bridge = new JSONSchemaBridge(schema, schemaValidator);

export default bridge;
github vazco / uniforms / docs / examples / CustomFields / CompositeFieldSchema.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

export default new JSONSchemaBridge(schema, schemaValidator);
github vazco / uniforms / docs / examples / Tutorial / GuestSchema.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

const bridge = new JSONSchemaBridge(schema, schemaValidator);

export default bridge;
github vazco / uniforms / docs / examples / Tutorial / GuestSchema3.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

const bridge = new JSONSchemaBridge(schema, schemaValidator);

export default bridge;
github vazco / uniforms / docs / examples / CustomFields / SwapFieldSchema.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

export default new JSONSchemaBridge(schema, schemaValidator);
github vazco / uniforms / docs / examples / CustomFields / RangeFieldSchema.js View on Github external
function createValidator(schema) {
  const validator = ajv.compile(schema);

  return model => {
    validator(model);

    if (validator.errors && validator.errors.length) {
      throw { details: validator.errors };
    }
  };
}

const schemaValidator = createValidator(schema);

export default new JSONSchemaBridge(schema, schemaValidator);

uniforms-bridge-json-schema

JSONSchema schema bridge for uniforms.

MIT
Latest version published 1 month ago

Package Health Score

72 / 100
Full package analysis