ensures that non-localized flexible content is still supported

This commit is contained in:
James
2019-12-26 12:09:51 -05:00
parent e56bb464a8
commit 211805d83f
4 changed files with 2 additions and 116 deletions

View File

@@ -134,7 +134,7 @@ export default function localizationPlugin(schema, options) {
});
schema.eachPath((path, schemaType) => {
if (schemaType.schema && schemaType.schema.discriminators) {
if (schemaType.schema && schemaType.options.localized && schemaType.schema.discriminators) {
Object.keys(schemaType.schema.discriminators).forEach((key) => {
if (schema.path(path)) {
schema.path(path).discriminator(key, schemaType.schema.discriminators[key]);