bcherny/json-schema-to-typescript

Add option to prepend "readonly" to all fields

Open

#627 opened on 2024年9月2日

GitHub で見る
 (1 comment) (2 reactions) (0 assignees)TypeScript (449 forks)github user discovery
enhancementgood first issuehelp wanted

Repository metrics

Stars
 (3,302 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

This would be nice to ensure i don't accidentally try playing with values from responses but create my own local copy instead

Example:

start "" json2ts -i "schemas/pietsmiet.de/*.schema.json" -o "src/responses/pietsmiet.de/" --inferStringEnumKeysFromValues true --readonly true
export interface PietsmietDEConfig {
    readonly API: Record<string, Record<string, string>>;
    readonly URLs: Record<string, string>;
    readonly Limits: Record<string, number>;
    readonly Orders: Record<string, string>;
    readonly Platform: Record<string, string>;
    readonly Stream: Record<string, string>;
  }
...

コントリビューターガイド