fix(config): remove identifier field validation (#1882)

This commit is contained in:
Shawn Erquhart 2018-11-21 22:32:50 -05:00 committed by GitHub
parent 6de47cdc56
commit fe6af1986f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,6 @@
import AJV from 'ajv';
import ajvErrors from 'ajv-errors';
import { formatExtensions, frontmatterFormats, extensionFormatters } from 'Formats/formats';
import { IDENTIFIER_FIELDS } from 'Constants/fieldInference';
/**
* Config for fields in both file and folder collections.
@ -119,20 +118,6 @@ const getConfigSchema = () => ({
},
required: ['format'],
},
folder: {
errorMessage: {
_: 'must have a field that is a valid entry identifier',
},
properties: {
fields: {
contains: {
properties: {
name: { enum: [{ $data: '3/identifier_field' }, ...IDENTIFIER_FIELDS] },
},
},
},
},
},
},
},
},
@ -170,7 +155,7 @@ class ConfigError extends Error {
* the config that is passed in.
*/
export function validateConfig(config) {
const ajv = new AJV({ allErrors: true, jsonPointers: true, $data: true });
const ajv = new AJV({ allErrors: true });
ajvErrors(ajv);
const valid = ajv.validate(getConfigSchema(), config);