Compare commits

...

6 Commits

2 changed files with 4 additions and 1 deletions
@@ -490,6 +490,7 @@ name = "allowed-path"
expect(error.errorType).toBe('schema_validation');
expect(error.details).toContain('toolName');
expect(error.details).toContain('Invalid input');
expect(error.suggestion).toContain('toolName');
});
it('should return a schema_validation error if priority is missing', async () => {
@@ -502,6 +503,7 @@ decision = "allow"
const error = result.errors[0];
expect(error.errorType).toBe('schema_validation');
expect(error.details).toContain('priority');
expect(error.suggestion).toContain('toolName');
});
it('should return a schema_validation error if priority is a float', async () => {
@@ -598,6 +600,7 @@ priority = 100
expect(error.errorType).toBe('schema_validation');
expect(error.details).toContain('toolName');
expect(error.details).toContain('Invalid input');
expect(error.suggestion).toContain('toolName');
});
it('should return a schema_validation error if toolName is not a string or array', async () => {
+1 -1
View File
@@ -383,7 +383,7 @@ export async function loadPoliciesFromToml(
message: 'Schema validation failed',
details: formatSchemaError(validationResult.error, 0),
suggestion:
'Ensure all required fields (decision, priority) are present with correct types',
'Ensure all required fields (decision, priority, toolName) are present with correct types',
});
continue;
}