diff --git a/src/macrofier/types.mjs b/src/macrofier/types.mjs index 17bfa9f3..35fd88e0 100644 --- a/src/macrofier/types.mjs +++ b/src/macrofier/types.mjs @@ -664,7 +664,12 @@ function getSchemaShape(schema = {}, module = {}, { templateDir = 'types', paren else if (schema.type) { const shape = insertPrimitiveMacros(getTemplate(path.join(templateDir, 'primitive' + suffix)), schema, module, theTitle, templateDir) result = result.replace(/\$\{shape\}/g, shape) + if (!config.langcode) { return insertSchemaMacros(result, schema, module, { name: theTitle, parent, property, required, templateDir }) + } + if (level > 0 || primitive) { + return insertSchemaMacros(result, schema, module, { name: theTitle, parent, property, required, templateDir }) + } } return ''