Skip to content

Commit

Permalink
schema generation adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
tytremblay committed Dec 13, 2024
1 parent d1e4a81 commit 2262174
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ jobs:
run: npm install
- name: Build
run: npm run build
- name: Generate Schema
run: npm run schema
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
Expand Down
3 changes: 3 additions & 0 deletions public/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
],
"additionalProperties": false
}
},
"$schema": {
"type": "string"
}
},
"required": [
Expand Down
3 changes: 3 additions & 0 deletions src/assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
],
"additionalProperties": false
}
},
"$schema": {
"type": "string"
}
},
"required": [
Expand Down
7 changes: 6 additions & 1 deletion src/scripts/generateJsonSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { z } from 'zod';
import { zodToJsonSchema } from 'zod-to-json-schema';
import { configSchema } from '../components/inputs/BaseInputProps';

const schema = zodToJsonSchema(configSchema);
const schemaSchema = configSchema.extend({
$schema: z.string().optional(),
});

const schema = zodToJsonSchema(schemaSchema);

console.log(JSON.stringify(schema, null, 2));

0 comments on commit 2262174

Please sign in to comment.