You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Action input '${paramName}' in '${actionName}' has type '${typeText}' but lacks 'complex_data_type_name' or 'schema'. Consider specifying the object schema for better type validation.`,
117
-
DiagnosticSeverity.Warning,
118
-
'object-type-missing-schema'
119
-
)
120
-
);
120
+
consthasComplexDataTypeField=hasStringField(
121
+
props,
122
+
'complex_data_type_name'
123
+
);
124
+
125
+
if(!isComplexType(typeText)){
126
+
// Primitive types must NOT declare complex_data_type_name.
127
+
if(hasComplexDataTypeField){
128
+
attachDiagnostic(
129
+
obj,
130
+
lintDiagnostic(
131
+
getDeclRange(obj),
132
+
`Action ${kind} '${paramName}' in '${actionName}' has primitive type '${typeText}' and must not specify 'complex_data_type_name'. Only 'object' and 'list[object]' types support 'complex_data_type_name'.`,
// Inputs may use `schema` as an alternative to `complex_data_type_name`.
143
+
consthasSchema=
144
+
hasComplexDataTypeField||
145
+
(kind==='input'&&hasStringField(props,'schema'));
146
+
console.log('Schema: ',hasSchema);
147
+
if(!hasSchema){
148
+
constrequired=
149
+
kind==='input'
150
+
? `'complex_data_type_name' or 'schema'`
151
+
: `'complex_data_type_name'`;
138
152
attachDiagnostic(
139
153
obj,
140
154
lintDiagnostic(
141
155
getDeclRange(obj),
142
-
`Action output '${outputName}' in '${actionName}' has type '${typeText}' but lacks 'complex_data_type_name'. Consider specifying the object schema for better type validation.`,
156
+
`Action ${kind} '${paramName}' in '${actionName}' has type '${typeText}' but lacks ${required}. Consider specifying the object schema for better type validation.`,
0 commit comments