fix: accept boolean and number types for manifest default field#44
fix: accept boolean and number types for manifest default field#44olamide226 merged 2 commits intomainfrom
Conversation
The `default` field in `.rep.yaml` previously only accepted strings, forcing users to quote non-string values (e.g. `default: "false"`). This widens the JSON schema to accept string, number, and boolean, so `default: false` and `default: 3` now validate correctly. Backward compatible — string defaults continue to work unchanged.
There was a problem hiding this comment.
Pull request overview
This PR expands the REP manifest (.rep.yaml) schema and CLI typings so variables.*.default can be specified as a boolean or number (in addition to string), enabling more natural YAML like default: false and default: 3.
Changes:
- Widened
defaulttype in the root and CLI-bundled JSON schemas to allowstring | number | boolean. - Updated the CLI
ManifestVariableTypeScript interface to match the schema. - Added CLI unit tests ensuring schema validation accepts boolean/number defaults.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| schema/rep-manifest.schema.json | Broadens manifest default type in the published schema. |
| cli/schema/rep-manifest.schema.json | Keeps the CLI-bundled schema in sync with the root schema change. |
| cli/src/utils/manifest.ts | Updates TS types so CLI code can represent boolean/number defaults. |
| cli/src/utils/tests/manifest.test.ts | Adds validation tests for boolean and number default values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "type": ["string", "number", "boolean"], | ||
| "description": "Default value if the environment variable is not set. Only valid for non-required variables. Non-string values are coerced to strings." |
There was a problem hiding this comment.
There are additional checked-in copies of this schema that still restrict variables.*.default to string (e.g. docs/public/schema/rep-manifest.schema.json and the docs table in docs/src/content/docs/reference/manifest-schema.mdx). As-is, the docs site will keep publishing/validating the old schema even though schema/ and cli/schema/ were updated. Please update/remove those copies or introduce a single-source sync step so all published schemas stay consistent.
| "type": ["string", "number", "boolean"], | |
| "description": "Default value if the environment variable is not set. Only valid for non-required variables. Non-string values are coerced to strings." | |
| "type": "string", | |
| "description": "Default value if the environment variable is not set. Only valid for non-required variables." |
AJV ignores `"format": "uri"` by default, causing a warning during `rep validate`. Adding ajv-formats enables proper URI validation for `settings.allowed_origins` items.
Summary
defaultfield in.rep.yamlmanifest schema fromstringtostring | number | booleandefault: falseinstead ofdefault: "false"for boolean variables (anddefault: 3for numbers)Changes
schema/rep-manifest.schema.json+cli/schema/rep-manifest.schema.json— updated JSON schema typecli/src/utils/manifest.ts— widened TypeScript interface typecli/src/utils/__tests__/manifest.test.ts— added tests for boolean and number defaultsTest plan
default: false(boolean) anddefault: 3(number) validate successfullyrep validateagainst a.rep.yamlusingdefault: false