jsontypedef / json-typedef-codegen

A CLI tool that generates code from JSON Typedef schemas
https://jsontypedef.com/docs/tools/jtd-codegen
MIT License
160 stars 31 forks source link

feat(target_typescript): add support for additionalProperties #89

Open mashizora opened 3 months ago

mashizora commented 3 months ago

Add support for additionalProperties in typescript output target.

Example

JSON Typedef:

{
    "properties": {
        "name": { "type": "string" },
        "isAdmin": { "type": "boolean" }
    },
    "additionalProperties": true
}

Generated TypeScript code:

export interface Root {
  isAdmin: boolean;
  name: string;
  [x: string]: unknown;
}