Skip to content

Commit 93ee015

Browse files
committed
fix: missing in schema json
1 parent 45d93d1 commit 93ee015

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

packages/docs/public/schemas/0.5/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"type": "object",
33
"properties": {
4+
"$schema": {
5+
"type": "string",
6+
"title": "$schema"
7+
},
48
"output": {
59
"type": "object",
610
"properties": {

packages/policygen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "policygen",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "A CLI tool to generate policies",
55
"bin": {
66
"policygen": "./dist/index.js"

packages/policygen/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ export type OutputConfig = {
191191
};
192192

193193
export type PolicygenConfig = {
194+
$schema?: string;
194195
output: OutputConfig;
195196
entity: EntityConfig;
196197
privacy?: PrivacyConfig;

packages/policygen/src/utils/loadConfig.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ export function loadConfig(): PolicygenConfig {
1818
}
1919

2020
const raw = fs.readFileSync(configPath, "utf-8");
21-
const parsed = JSON.parse(raw) as Partial<PolicygenConfig> & {
22-
$schema?: string;
23-
}; // Allow $schema as an extra field
21+
const parsed = JSON.parse(raw) as Partial<PolicygenConfig>; // Allow $schema as an extra field
2422

2523
// Get the schema version from the `$schema` field
2624
const schemaUrl = parsed.$schema;
27-
delete parsed.$schema; // Remove the $schema field from the object
2825
if (!schemaUrl) {
2926
console.error("❌ Config file is missing the `$schema` field.");
3027
process.exit(1);

0 commit comments

Comments
 (0)