diff --git a/src/{{ project_name_snake }}/export_types.py b/src/{{ project_name_snake }}/export_types.py index 8c58aad..2749ce1 100644 --- a/src/{{ project_name_snake }}/export_types.py +++ b/src/{{ project_name_snake }}/export_types.py @@ -49,7 +49,7 @@ def export_types(schema_file: str): def generate_typescript_interfaces(schema_dir: Path): run_command( - f"npx -y json-schema-to-typescript@15.0.4 -i '{schema_dir / '*.json'}' -o {schema_dir}" + f"npx -y json-schema-to-typescript@15.0.4 -i '{schema_dir / '*.json'}' -o {schema_dir} --additionalProperties=false" ) run_command(f"npx -y prettier@3.5.1 --write {schema_dir}") diff --git a/test-proj/src/test_proj/export_types.py b/test-proj/src/test_proj/export_types.py index 8c58aad..2749ce1 100644 --- a/test-proj/src/test_proj/export_types.py +++ b/test-proj/src/test_proj/export_types.py @@ -49,7 +49,7 @@ def export_types(schema_file: str): def generate_typescript_interfaces(schema_dir: Path): run_command( - f"npx -y json-schema-to-typescript@15.0.4 -i '{schema_dir / '*.json'}' -o {schema_dir}" + f"npx -y json-schema-to-typescript@15.0.4 -i '{schema_dir / '*.json'}' -o {schema_dir} --additionalProperties=false" ) run_command(f"npx -y prettier@3.5.1 --write {schema_dir}") diff --git a/test-proj/ui/src/schemas/MySchema.d.ts b/test-proj/ui/src/schemas/MySchema.d.ts index 42a7105..524f880 100644 --- a/test-proj/ui/src/schemas/MySchema.d.ts +++ b/test-proj/ui/src/schemas/MySchema.d.ts @@ -9,5 +9,4 @@ export type Hello = string; export interface MySchema { hello: Hello; - [k: string]: unknown; } diff --git a/ui/src/schemas/MySchema.d.ts b/ui/src/schemas/MySchema.d.ts index 42a7105..524f880 100644 --- a/ui/src/schemas/MySchema.d.ts +++ b/ui/src/schemas/MySchema.d.ts @@ -9,5 +9,4 @@ export type Hello = string; export interface MySchema { hello: Hello; - [k: string]: unknown; }