mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 21:43:07 +00:00
- Replace hardcoded ['list', 'id', 'url'] modes with schema-based validation - Read allowed modes from prop.typeOptions.resourceLocator.modes - Support both object and array mode definition formats - Add Google Sheets range/columns flexibility for v4+ nodes - Implement Set node JSON structure validation - Update tests to verify schema-based validation Fixes #304 (Google Sheets "name" mode false positive) Fixes #306 (Set node validation gaps) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -678,7 +678,7 @@ describe('ConfigValidator - Basic Validation', () => {
|
||||
expect(result.errors[0].fix).toContain('{ mode: "id", value: "gpt-4o-mini" }');
|
||||
});
|
||||
|
||||
it('should reject invalid mode values', () => {
|
||||
it('should reject invalid mode values when schema defines allowed modes', () => {
|
||||
const nodeType = '@n8n/n8n-nodes-langchain.lmChatOpenAi';
|
||||
const config = {
|
||||
model: {
|
||||
@@ -690,7 +690,16 @@ describe('ConfigValidator - Basic Validation', () => {
|
||||
{
|
||||
name: 'model',
|
||||
type: 'resourceLocator',
|
||||
required: true
|
||||
required: true,
|
||||
typeOptions: {
|
||||
resourceLocator: {
|
||||
modes: {
|
||||
list: { displayName: 'List' },
|
||||
id: { displayName: 'ID' },
|
||||
url: { displayName: 'URL' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -700,7 +709,7 @@ describe('ConfigValidator - Basic Validation', () => {
|
||||
expect(result.errors.some(e =>
|
||||
e.property === 'model.mode' &&
|
||||
e.type === 'invalid_value' &&
|
||||
e.message.includes("must be 'list', 'id', or 'url'")
|
||||
e.message.includes('must be one of [list, id, url]')
|
||||
)).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user