generating-custom-lightning-type
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to Use This Skill
何时使用本技能
Use this skill when you need to:
- Create Custom Lightning Types (CLTs) for structured inputs/outputs
- Generate JSON Schema-based type definitions for Lightning Platform
- Configure CLTs for Einstein Agent actions
- Set up editor and renderer configurations for custom UI
- Troubleshoot deployment errors related to Custom Lightning Types
当你需要以下操作时,请使用本技能:
- 为结构化输入/输出创建Custom Lightning Types(CLTs)
- 为Lightning Platform生成基于JSON Schema的类型定义
- 为Einstein Agent操作配置CLTs
- 为自定义UI设置编辑器和渲染器配置
- 排查与Custom Lightning Types相关的部署错误
Specification
规范
CustomLightningType Metadata Specification
CustomLightningType元数据规范
Overview & Purpose
概述与用途
Custom Lightning Types (CLTs) are JSON Schema-based type definitions used by the Lightning Platform (including Einstein Agent actions) to describe structured inputs/outputs and drive editor/renderer experiences.
Custom Lightning Types(CLTs)是基于JSON Schema的类型定义,被Lightning Platform(包括Einstein Agent操作)用于描述结构化输入/输出,并驱动编辑器/渲染器体验。
Configuration
配置
- Choose referenced CLT pattern for nested objects - When you need a reusable or separately deployed nested type, create a CLT for that shape and reference it with . That string is the referenced type’s
"lightning:type": "c__<CLTName>"value / FQN / registered identifier — not the JSON Schemalightning:type.title - Choose standard Lightning types when the structure is simple and can be expressed with properties and supported primitive identifiers.
lightning:type - Choose Apex class types () when the structure already exists server-side and you want the Apex class to define the shape.
@apexClassType/... - Include editor/renderer config only when you need custom UI behavior (custom LWC input/output components). Otherwise, omit.
- 为嵌套对象选择引用CLT模式 - 当你需要可复用或独立部署的嵌套类型时,为该结构创建一个CLT,并使用引用它。该字符串是被引用类型的**
"lightning:type": "c__<CLTName>"值/完全限定名(FQN)/注册标识符** —— 而非JSON Schema的lightning:type。title - 当结构简单且可通过属性和受支持的原始标识符表达时,选择标准Lightning类型。
lightning:type - 当结构已在服务器端存在且希望通过Apex类定义其形状时,选择Apex类类型()。
@apexClassType/... - 仅当需要自定义UI行为(自定义LWC输入/输出组件)时,才包含编辑器/渲染器配置,否则请省略。
Critical Rules (Read First)
关键规则(请先阅读)
- Root object schemas MUST include:
"type": "object""title""lightning:type": "lightning__objectType""unevaluatedProperties": false
- is enforced as
"unevaluatedProperties"by the CLT metaschema. Do not set it tofalse.true - Root object schemas MUST NOT include when
"examples"is set."unevaluatedProperties": false - Nested objects (inside ) MUST NOT set
properties."lightning:type": "lightning__objectType"- Nested objects can be: references to other CLTs using syntax.
c__<CLTName>
- Nested objects can be: references to other CLTs using
- List/array properties are highly restricted by the CLT metaschema:
- CRITICAL LIMITATION: the CLT metaschema may reject the keyword entirely. Treat
itemsas disallowed by default.items - Root-level arrays (direct children of the root ):
properties- MUST include
"lightning:type": "lightning__listType" - MUST NOT include
"items" - OPTIONAL
"type": "array"
- MUST include
- Nested arrays (arrays inside nested objects) are the most common failure:
- MUST include
"type": "array" - MUST NOT include
"lightning:type": "lightning__listType" - MUST NOT include
"items"
- MUST include
- CRITICAL LIMITATION: the CLT metaschema may reject the
- When is set, any unknown keyword will fail validation. Prefer removing keywords over relaxing strictness.
"unevaluatedProperties": false - Apex class CLTs are minimal:
- Include only ,
title(optional), anddescriptionset tolightning:type.@apexClassType/... - Do not add ,
type,properties, orrequired.unevaluatedProperties
- Include only
- 根对象Schema必须包含:
"type": "object""title""lightning:type": "lightning__objectType""unevaluatedProperties": false
- CLT元Schema强制要求为
"unevaluatedProperties",请勿将其设置为false。true - 当设置了时,根对象Schema不得包含
"unevaluatedProperties": false。"examples" - 嵌套对象(位于内)不得设置
properties。"lightning:type": "lightning__objectType"- 嵌套对象可以是:使用语法引用其他CLTs。
c__<CLTName>
- 嵌套对象可以是:使用
- CLT元Schema对列表/数组属性有严格限制:
- 关键限制:CLT元Schema可能完全拒绝关键字。默认情况下,请将
items视为不允许使用。items - 根级数组(根的直接子项):
properties- 必须包含
"lightning:type": "lightning__listType" - 不得包含
"items" - 可选
"type": "array"
- 必须包含
- 嵌套数组(嵌套对象内的数组)是最常见的失败点:
- 必须包含
"type": "array" - 不得包含
"lightning:type": "lightning__listType" - 不得包含
"items"
- 必须包含
- 关键限制:CLT元Schema可能完全拒绝
- 当设置了时,任何未知关键字都会导致验证失败。优先移除关键字而非放宽严格性。
"unevaluatedProperties": false - 基于Apex类的CLTs需保持极简:
- 仅包含**、可选的
title**,以及设置为description的@apexClassType/...。lightning:type - 请勿添加、
type、properties或required。unevaluatedProperties
- 仅包含**
Additional CLT Metaschema Validations
额外CLT元Schema验证
- Org namespace validation: titles/descriptions and other string fields may be validated to ensure you are not using an org namespace in places that are disallowed.
- Lightning type validation: CLTs are validated to prevent referencing internal namespaces (for example, disallowing types from internal namespaces like where not permitted).
sfdc_cms - Object type validation: the CLT root is validated to ensure is exactly
lightning:type.lightning__objectType
- Org命名空间验证:标题/描述及其他字符串字段可能会被验证,以确保你未在不允许的位置使用Org命名空间。
- Lightning类型验证:CLTs会被验证以防止引用内部命名空间(例如,在不允许的情况下禁止引用等内部命名空间的类型)。
sfdc_cms - 对象类型验证:CLT根会被验证以确保严格等于
lightning:type。lightning__objectType
Primitive Types & Constraints
原始类型与约束
lightning__textType- Max length 255
lightning__multilineTextType- Max length 2000
lightning__richTextType- Max length 100000
lightning__urlType- Max length 2000
- Optional enum values:
lightning:allowedUrlSchemes,https,http,relative,mailtotel
lightning__dateType- Data pattern: YYYY-MM-DD
lightning__timeType- Data pattern: HH:MM:SS.sssZ
lightning__dateTimeType- Data shape is an object with required and optional
dateTimetimeZone
- Data shape is an object with required
lightning__numberType- Decimal numbers; optional ,
maximum,minimummultipleOf
- Decimal numbers; optional
lightning__integerType- Whole numbers only; optional ,
maximumminimum
- Whole numbers only; optional
lightning__booleanType- true/false
lightning__textType- 最大长度255
lightning__multilineTextType- 最大长度2000
lightning__richTextType- 最大长度100000
lightning__urlType- 最大长度2000
- 可选的枚举值:
lightning:allowedUrlSchemes,https,http,relative,mailtotel
lightning__dateType- 数据格式:YYYY-MM-DD
lightning__timeType- 数据格式:HH:MM:SS.sssZ
lightning__dateTimeType- 数据结构是包含必填和可选
dateTime的对象timeZone
- 数据结构是包含必填
lightning__numberType- 十进制数字;可选,
maximum,minimummultipleOf
- 十进制数字;可选
lightning__integerType- 仅支持整数;可选,
maximumminimum
- 仅支持整数;可选
lightning__booleanType- true/false
Allowed Property-Level Keywords
允许的属性级关键字
When strict validation is enabled (), keep each property minimal and prefer only keywords known to be allowed:
unevaluatedProperties: false- ,
title,descriptioneinstein:description - (when used, ensure it matches the chosen
type)lightning:type lightning:type- ,
maximum,minimum(numeric)multipleOf - ,
maxLength(string)minLength - ,
constenum - ,
lightning:textIndexed,lightning:supportsPersonalizationlightning:localizable - ,
lightning:uiOptionslightning:allowedUrlSchemes - (metaschema restricts values; currently
lightning:tagsis the only known allowed tag)flow
当启用严格验证()时,保持每个属性极简,优先仅使用已知允许的关键字:
unevaluatedProperties: false- ,
title,descriptioneinstein:description - (使用时请确保与所选
type匹配)lightning:type lightning:type- ,
maximum,minimum(数值类型)multipleOf - ,
maxLength(字符串类型)minLength - ,
constenum - ,
lightning:textIndexed,lightning:supportsPersonalizationlightning:localizable - ,
lightning:uiOptionslightning:allowedUrlSchemes - (元Schema限制值;目前已知唯一允许的标签是
lightning:tags)flow
Generation Workflow
生成流程
- Confirm the CLT approach
- If referencing Apex: capture the exact class reference ().
@apexClassType/namespace__ClassName$InnerClass - If using standard primitives: list the fields, their Lightning primitive types, and which fields are required.
- If referencing Apex: capture the exact class reference (
- Draft
schema.json- Start with the root object structure (required root fields).
- Add using valid primitive
propertiesidentifiers.lightning:type - For nested-object properties, use CLT Reference pattern:
- to reference another CLT
"lightning:type": "c__<CLTName>" - The referenced CLT must be deployed to the org before the parent CLT.
- For Apex-based nested objects: Use when structure exists server-side.
@apexClassType/... - If the prompt explicitly requires true nested object output, prefer an Apex-based CLT () for deploy-safe nested structures.
@apexClassType/... - For arrays: follow the strict list rules (avoid ; avoid
itemson nested arrays).lightning:type - Before deployment, verify exact spellings (for example, use
lightning:type, not misspelled variants).lightning__richTextType
- (Optional) Draft (only if custom UI is required)
editor.json- Supported shape: Top-level object with
editorandeditor.componentOverrides.editor.layout- Top-level object.
editor - Use for component overrides.
editor.componentOverrides - Use for layout.
editor.layout - DEPRECATED: Do NOT use or
propertyRenderers— these are legacy keys. Always useviewandcomponentOverridesinstead.layout
- Top-level
- Root override pattern (most common for fully custom editing UI):
editor.componentOverrides["$"] = { "definition": "c/<yourEditorComponent>", "attributes": { ... } }- When passing schema data into a custom LWC, use attribute mapping with the syntax: e.g.
{!$attrs.<name>}so the runtime binds schema values to your component's attributes."attributes": { "myField": "{!$attrs.value}" } - CRITICAL: The in
<name>must be a property defined in your type schema. For example, if your schema has a property called{!$attrs.<name>}, usetemperature, not{!$attrs.temperature}unless{!$attrs.value}is an actual property.value
- Property-level override pattern (for individual fields):
editor.componentOverrides["<propertyName>"] = { "definition": "es_property_editors/<...>" }- Valid editor components (examples): ,
es_property_editors/inputText,es_property_editors/inputNumber,es_property_editors/inputRichText,es_property_editors/inputImage. Do not usees_property_editors/inputTextarea.es_property_editors/inputList
- Collection editor (for root-level properties): Use a collection-level override so the list is edited by a custom component:
lightning__listType. Alternatively, usecollection.editor.componentOverrides["$"] = { "definition": "c/<yourCollectionEditorComponent>" }witheditor.layoutandlightning/propertyLayoutfor default list editing.attributes.property = "<listPropertyName>" - Layout pattern:
editor.layout.definition = "lightning/verticalLayout"- with
editor.layout.children[*].definition = "lightning/propertyLayout"attributes.property = "<propertyName>" - CRITICAL: only accepts the
lightning/propertyLayoutattribute. Do NOT addproperty,label, or any other attributes — these will fail validation withtitleerrors.additionalProperties: false
- Avoid known-invalid patterns:
- Do not use .
es_property_editors/inputList - Do not use attributes.
itemSchema
- Do not use
- Supported shape: Top-level
- (Optional) Draft (only if custom UI is required)
renderer.json- Supported shape: Top-level object with
rendererandrenderer.componentOverrides.renderer.layout- Top-level object.
renderer - Use for component overrides.
renderer.componentOverrides - Use for layout.
renderer.layout - DEPRECATED: Do NOT use or
propertyRenderers— these are legacy keys. Always useviewandcomponentOverridesinstead.layout
- Top-level
- Root override pattern (most common for fully custom rendering UI):
renderer.componentOverrides["$"] = { "definition": "c/<yourRendererComponent>", "attributes": { ... } }- Use in attribute mappings when binding schema data to custom renderer component attributes.
{!$attrs.<name>} - CRITICAL: Attribute mappings like must reference properties that actually exist in your type schema. Referencing non-existent properties will fail validation.
{!$attrs.propertyName} - Type matching: Attribute values must match the expected type for the component. For example, if a component expects a string attribute, passing an integer will fail validation.
- Property-level override pattern:
- . Valid renderer components (examples):
renderer.componentOverrides["<propertyName>"] = { "definition": "es_property_editors/outputText" | "es_property_editors/outputNumber" | "es_property_editors/outputImage" | ... },es_property_editors/outputText,es_property_editors/outputNumber. Avoid input-style components in the renderer.es_property_editors/outputImage
- Layout pattern for renderer:
renderer.layout.definition = "lightning/verticalLayout"- with
renderer.layout.children[*].definition = "lightning/propertyLayout"attributes.property = "<propertyName>" - CRITICAL: Same as editor layouts, only accepts the
lightning/propertyLayoutattribute. Do NOT addproperty,label, or any other attributes.title
- Collection renderer (for root-level properties): Use
lightning__listTypeorcollection.renderer.componentOverrides["$"] = { "definition": "c/<yourListRendererComponent>" }to render the list.es_property_editors/genericListTypeRenderer
- Supported shape: Top-level
- Place files in the correct bundle structure
lightningTypes/<TypeName>/schema.json- (Optional)
lightningTypes/<TypeName>/lightningDesktopGenAi/editor.json - (Optional)
lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json - For Gen AI / Copilot the standard path is . Other targets (e.g. Experience Builder, Mobile Copilot, Enhanced Web Chat) use different subfolders when supported:
lightningDesktopGenAi/,experienceBuilder/,lightningMobileGenAi/.enhancedWebChat/
- Configure custom LWC components (if using custom components)
- CRITICAL: Custom LWC components referenced in editor/renderer configs MUST have the correct target configuration in their files:
-meta.xml- For editor components (used in
c/<componentName>): The LWC'seditor.jsonfile must include-meta.xml<target>lightning__AgentforceInput</target> - For renderer components (used in
c/<componentName>): The LWC'srenderer.jsonfile must include-meta.xml<target>lightning__AgentforceOutput</target>
- For editor components (
- Without the correct target, deployment will fail with:
Invalid target configuration. To use 'c/componentName' as a renderer/editor, your js-meta.xml file must include valid target 'lightning__AgentforceOutput/Input'. - Example for a renderer component:
-meta.xmlxml<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>60.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AgentforceOutput</target> </targets> </LightningComponentBundle>
- CRITICAL: Custom LWC components referenced in editor/renderer configs MUST have the correct target configuration in their
- Deploy and validate
- Run a final schema sanity check before deploy: valid names, required fields present, and no disallowed keywords.
lightning:type - Deploy the bundle using your org's standard metadata deployment flow (e.g. Salesforce CLI or IDE). The MCP client or tooling in use should provide or integrate with the appropriate deploy/retrieve commands for Lightning Type bundles.
- Validate incrementally: if deployment fails, remove disallowed keywords first (especially ,
examples, nesteditems).lightning:type
- Run a final schema sanity check before deploy: valid
- 确认CLT实现方式
- 如果引用Apex:捕获精确的类引用()。
@apexClassType/namespace__ClassName$InnerClass - 如果使用标准原始类型:列出字段、对应的Lightning原始类型,以及哪些字段是必填的。
- 如果引用Apex:捕获精确的类引用(
- 起草
schema.json- 从根对象结构(必填根字段)开始。
- 使用有效的原始标识符添加
lightning:type。properties - 对于嵌套对象属性,使用CLT引用模式:
- 以引用另一个CLT
"lightning:type": "c__<CLTName>" - 被引用的CLT必须在父CLT之前部署到Org中。
- 对于基于Apex的嵌套对象:当结构已在服务器端存在时,使用。
@apexClassType/... - 如果提示明确要求真正的嵌套对象输出,优先选择基于Apex的CLT()以确保部署安全的嵌套结构。
@apexClassType/... - 对于数组:遵循严格的列表规则(避免使用;避免在嵌套数组上设置
items)。lightning:type - 部署前,验证的拼写是否精确(例如,使用
lightning:type,而非拼写错误的变体)。lightning__richTextType
- (可选)起草(仅当需要自定义UI时)
editor.json- 支持的结构:顶级对象,包含
editor和editor.componentOverrides。editor.layout- 顶级对象。
editor - 使用进行组件覆盖。
editor.componentOverrides - 使用进行布局。
editor.layout - 已废弃:请勿使用或
propertyRenderers—— 这些是遗留关键字。请始终使用view和componentOverrides替代。layout
- 顶级
- 根覆盖模式(完全自定义编辑UI最常用):
editor.componentOverrides["$"] = { "definition": "c/<yourEditorComponent>", "attributes": { ... } }- 将Schema数据传递到自定义LWC时,使用语法进行属性映射:例如
{!$attrs.<name>},以便运行时将Schema值绑定到组件的属性。"attributes": { "myField": "{!$attrs.value}" } - 关键注意事项:中的
{!$attrs.<name>}必须是类型Schema中定义的属性。例如,如果你的Schema有一个名为<name>的属性,请使用temperature,而非{!$attrs.temperature},除非{!$attrs.value}是实际存在的属性。value
- 属性级覆盖模式(针对单个字段):
editor.componentOverrides["<propertyName>"] = { "definition": "es_property_editors/<...>" }- 有效的编辑器组件(示例):,
es_property_editors/inputText,es_property_editors/inputNumber,es_property_editors/inputRichText,es_property_editors/inputImage。请勿使用es_property_editors/inputTextarea。es_property_editors/inputList
- 集合编辑器(针对根级属性):使用集合级覆盖,以便通过自定义组件编辑列表:
lightning__listType。或者,使用collection.editor.componentOverrides["$"] = { "definition": "c/<yourCollectionEditorComponent>" }配合editor.layout和lightning/propertyLayout进行默认列表编辑。attributes.property = "<listPropertyName>" - 布局模式:
editor.layout.definition = "lightning/verticalLayout"- 并设置
editor.layout.children[*].definition = "lightning/propertyLayout"attributes.property = "<propertyName>" - 关键注意事项:仅接受
lightning/propertyLayout属性。请勿添加property,label或任何其他属性 —— 这些会导致title验证错误。additionalProperties: false
- 避免已知无效模式:
- 请勿使用。
es_property_editors/inputList - 请勿使用属性。
itemSchema
- 请勿使用
- 支持的结构:顶级
- (可选)起草(仅当需要自定义UI时)
renderer.json- 支持的结构:顶级对象,包含
renderer和renderer.componentOverrides。renderer.layout- 顶级对象。
renderer - 使用进行组件覆盖。
renderer.componentOverrides - 使用进行布局。
renderer.layout - 已废弃:请勿使用或
propertyRenderers—— 这些是遗留关键字。请始终使用view和componentOverrides替代。layout
- 顶级
- 根覆盖模式(完全自定义渲染UI最常用):
renderer.componentOverrides["$"] = { "definition": "c/<yourRendererComponent>", "attributes": { ... } }- 将Schema数据绑定到自定义渲染器组件属性时,在属性映射中使用。
{!$attrs.<name>} - 关键注意事项:等属性映射必须引用类型Schema中实际存在的属性。引用不存在的属性会导致验证失败。
{!$attrs.propertyName} - 类型匹配:属性值必须与组件预期的类型匹配。例如,如果组件期望字符串属性,传递整数会导致验证失败。
- 属性级覆盖模式:
- 。有效的渲染器组件(示例):
renderer.componentOverrides["<propertyName>"] = { "definition": "es_property_editors/outputText" | "es_property_editors/outputNumber" | "es_property_editors/outputImage" | ... },es_property_editors/outputText,es_property_editors/outputNumber。避免在渲染器中使用输入类组件。es_property_editors/outputImage
- 渲染器布局模式:
renderer.layout.definition = "lightning/verticalLayout"- 并设置
renderer.layout.children[*].definition = "lightning/propertyLayout"attributes.property = "<propertyName>" - 关键注意事项:与编辑器布局相同,仅接受
lightning/propertyLayout属性。请勿添加property,label或任何其他属性。title
- 集合渲染器(针对根级属性):使用
lightning__listType或collection.renderer.componentOverrides["$"] = { "definition": "c/<yourListRendererComponent>" }来渲染列表。es_property_editors/genericListTypeRenderer
- 支持的结构:顶级
- 将文件放置在正确的包结构中
lightningTypes/<TypeName>/schema.json- (可选)
lightningTypes/<TypeName>/lightningDesktopGenAi/editor.json - (可选)
lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json - 对于生成式AI/Copilot,标准路径为。其他目标(如Experience Builder、Mobile Copilot、Enhanced Web Chat)在支持时使用不同的子文件夹:
lightningDesktopGenAi/,experienceBuilder/,lightningMobileGenAi/。enhancedWebChat/
- 配置自定义LWC组件(如果使用自定义组件)
- 关键注意事项:编辑器/渲染器配置中引用的自定义LWC组件必须在其文件中包含正确的目标配置:
-meta.xml- 对于编辑器组件(中使用的
editor.json):LWC的c/<componentName>文件必须包含-meta.xml<target>lightning__AgentforceInput</target> - 对于渲染器组件(中使用的
renderer.json):LWC的c/<componentName>文件必须包含-meta.xml<target>lightning__AgentforceOutput</target>
- 对于编辑器组件(
- 若无正确目标,部署会失败并提示:
Invalid target configuration. To use 'c/componentName' as a renderer/editor, your js-meta.xml file must include valid target 'lightning__AgentforceOutput/Input'. - 渲染器组件的示例:
-meta.xmlxml<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>60.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AgentforceOutput</target> </targets> </LightningComponentBundle>
- 关键注意事项:编辑器/渲染器配置中引用的自定义LWC组件必须在其
- 部署与验证
- 部署前运行最终的Schema完整性检查:验证名称有效、必填字段存在、无不允许的关键字。
lightning:type - 使用Org的标准元数据部署流程(如Salesforce CLI或IDE)部署包。所使用的MCP客户端或工具应提供或集成适用于Lightning Type包的部署/检索命令。
- 增量验证:如果部署失败,优先移除不允许的关键字(尤其是,
examples, 嵌套items)。lightning:type
- 部署前运行最终的Schema完整性检查:验证
Common Deployment Errors
常见部署错误
| Error / Symptom | Likely Cause | Fix |
|---|---|---|
| Schema validation fails due to unknown keyword | | Remove the offending keyword; keep schema minimal |
| Nested object validation failure | Org/channel validation rejects nested object typing in | Use CLT reference ( |
| Invalid CLT reference | Referenced CLT doesn't exist in org or incorrect syntax | Deploy the referenced CLT first; |
Invalid or misspelled | Incorrect generated type name | Cross-check all |
| Array property rejected | Use of | For nested arrays: keep only |
| Apex-based CLT rejected | Extra fields added (e.g., | Use only |
| Editor config rejected | Use of invalid patterns ( | Use |
| Adding | Only use |
| Invalid target configuration for custom LWC | Custom LWC component's | Add correct target to LWC's |
| Attribute mapping doesn't exist in type schema | Using | Ensure all attribute mappings reference actual properties in your type schema's |
| Using | Replace deprecated |
| Type mismatch in component attributes | Passing wrong type for component attribute (e.g., integer instead of string) | Ensure attribute values match the expected type defined by the component |
| 错误/症状 | 可能原因 | 修复方案 |
|---|---|---|
| Schema因未知关键字验证失败 | | 移除违规关键字;保持Schema极简 |
| 嵌套对象验证失败 | Org/渠道验证拒绝 | 使用CLT引用( |
| 无效CLT引用 | 被引用的CLT不存在于Org中或语法错误 | 先部署被引用的CLT; |
无效或拼写错误的 | 生成的类型名称不正确 | 对照支持的类型名称核对所有 |
| 数组属性被拒绝 | 验证器拒绝使用 | 对于嵌套数组:仅保留 |
| 基于Apex的CLT被拒绝 | 添加了额外字段(如 | 仅使用 |
| 编辑器配置被拒绝 | 使用了无效模式( | 使用 |
布局属性出现 | 向 | |
| 自定义LWC的目标配置无效 | 自定义LWC组件的 | 向LWC的 |
| 属性映射在类型Schema中不存在 | 使用 | 确保所有属性映射都引用类型Schema的 |
使用已废弃关键字出现 | 在编辑器/渲染器配置中使用 | 将已废弃的 |
| 组件属性类型不匹配 | 为组件属性传递了错误类型(例如,整数而非字符串) | 确保属性值与组件定义的预期类型匹配 |
Verification Checklist
验证清单
- Root schema has ,
type: "object",title, andlightning:type: "lightning__objectType"unevaluatedProperties: false - Root schema does not include when strict validation is enabled
examples - No nested object includes
lightning:type: "lightning__objectType" - Arrays are defined minimally (especially nested arrays)
- Only supported primitive identifiers are used for leaf properties
lightning:type - Apex class CLTs contain only /
titleanddescriptionlightning:type: "@apexClassType/..." - Bundle structure and filenames match Lightning Types requirements
- Editor config uses only allowed patterns (no , no
es_property_editors/inputList); use valid components (e.g.itemSchema,es_property_editors/inputText) or customes_property_editors/inputNumbercomponentsc/ - Renderer config uses output-style components (e.g. ,
es_property_editors/outputText) where applicable, not input editorses_property_editors/outputNumber - Layout configurations use with ONLY the
lightning/propertyLayoutattribute (noproperty,label, or other attributes)title - All attribute mappings () reference properties that exist in the type schema
{!$attrs.propertyName} - Custom LWC components have correct targets in :
-meta.xmlfor editors,lightning__AgentforceInputfor rendererslightning__AgentforceOutput
- 根Schema包含,
type: "object",title和lightning:type: "lightning__objectType"unevaluatedProperties: false - 启用严格验证时,根Schema不包含
examples - 没有嵌套对象包含
lightning:type: "lightning__objectType" - 数组定义保持极简(尤其是嵌套数组)
- 叶子属性仅使用受支持的原始标识符
lightning:type - 基于Apex类的CLTs仅包含/
title和descriptionlightning:type: "@apexClassType/..." - 包结构和文件名符合Lightning Types的要求
- 编辑器配置仅使用允许的模式(不使用, 不使用
es_property_editors/inputList);使用有效组件(如itemSchema,es_property_editors/inputText)或自定义es_property_editors/inputNumber组件c/ - 渲染器配置在适用时使用输出类组件(如,
es_property_editors/outputText),而非输入编辑器es_property_editors/outputNumber - 布局配置使用且仅包含
lightning/propertyLayout属性(无property,label或其他属性)title - 所有属性映射()都引用类型Schema中存在的属性
{!$attrs.propertyName} - 自定义LWC组件在中有正确的目标:编辑器使用
-meta.xml,渲染器使用lightning__AgentforceInputlightning__AgentforceOutput