diff --git a/apps/cli/src/linter/schema.ts b/apps/cli/src/linter/schema.ts index 1ddd63a..3b0bc08 100644 --- a/apps/cli/src/linter/schema.ts +++ b/apps/cli/src/linter/schema.ts @@ -3,7 +3,7 @@ import { z } from 'zod'; const idSchema = z .string() .min(1) - .max(64) + .max(256) .regex(/^[a-zA-Z0-9-_.]+$/); const nameSchema = z .string() diff --git a/apps/cli/src/linter/specs/common.spec.ts b/apps/cli/src/linter/specs/common.spec.ts index 3570dbe..559c785 100644 --- a/apps/cli/src/linter/specs/common.spec.ts +++ b/apps/cli/src/linter/specs/common.spec.ts @@ -70,6 +70,44 @@ describe('Common Linter', () => { } as ADCSDK.Configuration, expect: true, }, + { + name: 'should check id length (length <= 256)', + input: { + services: [ + { + id: ''.padEnd(256, '0'), + name: 'name', + routes: [], + }, + ], + } as ADCSDK.Configuration, + expect: true, + errors: [], + }, + { + name: 'should check id length (length > 256)', + input: { + services: [ + { + id: ''.padEnd(257, '0'), + name: 'name', + routes: [], + }, + ], + } as ADCSDK.Configuration, + expect: false, + errors: [ + { + code: 'too_big', + exact: false, + inclusive: true, + maximum: 256, + message: 'String must contain at most 256 character(s)', + path: ['services', 0, 'id'], + type: 'string', + }, + ], + }, ]; // test cases runner diff --git a/schema.json b/schema.json index 8619cab..36c3e99 100644 --- a/schema.json +++ b/schema.json @@ -9,7 +9,7 @@ "id": { "type": "string", "minLength": 1, - "maxLength": 64, + "maxLength": 256, "pattern": "^[a-zA-Z0-9-_.]+$" }, "name": {