fix(config): remove identifier field validation (#1882)
This commit is contained in:
parent
6de47cdc56
commit
fe6af1986f
@ -1,7 +1,6 @@
|
|||||||
import AJV from 'ajv';
|
import AJV from 'ajv';
|
||||||
import ajvErrors from 'ajv-errors';
|
import ajvErrors from 'ajv-errors';
|
||||||
import { formatExtensions, frontmatterFormats, extensionFormatters } from 'Formats/formats';
|
import { formatExtensions, frontmatterFormats, extensionFormatters } from 'Formats/formats';
|
||||||
import { IDENTIFIER_FIELDS } from 'Constants/fieldInference';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config for fields in both file and folder collections.
|
* Config for fields in both file and folder collections.
|
||||||
@ -119,20 +118,6 @@ const getConfigSchema = () => ({
|
|||||||
},
|
},
|
||||||
required: ['format'],
|
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.
|
* the config that is passed in.
|
||||||
*/
|
*/
|
||||||
export function validateConfig(config) {
|
export function validateConfig(config) {
|
||||||
const ajv = new AJV({ allErrors: true, jsonPointers: true, $data: true });
|
const ajv = new AJV({ allErrors: true });
|
||||||
ajvErrors(ajv);
|
ajvErrors(ajv);
|
||||||
|
|
||||||
const valid = ajv.validate(getConfigSchema(), config);
|
const valid = ajv.validate(getConfigSchema(), config);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user