して TS 向けに改変 …将来の多⾔語対応を⾒据え、 複数⾔語の型定義を⽣成できる 単⼀の Rust 製ツールを⽬指す 3 9 export type Input = { /** All data from Google Cloud integr googleCloud: { /** Projects in Google Cloud */ projects: Array<{ /** Data on Google Cloud Storage cloudStorage: { /** All Google Cloud Storage bu buckets: Array<{ /** The bucket name */ name: string, /** The list of access contro acl: Array<{ entity: string, role: | "OWNER" | "READER" | "WRITER", }>, /** The IAM policy of the Goo iamPolicy: { 型定義 コード⽣成 Rego 他⾔語
All data from Google Cloud integr googleCloud: { /** Projects in Google Cloud */ projects: Array<{ /** Data on Google Cloud Storage cloudStorage: { /** All Google Cloud Storage bu buckets: Array<{ /** The bucket name */ name: string, /** The list of access contro acl: Array<{ entity: string, role: | "OWNER" | "READER" | "WRITER", }>, /** The IAM policy of the Goo iamPolicy: { • 単⼀の⼤きなネストした型定義を⽣成 • ⼊⼒データの全体構造が⼀⽬でわかる • 型だけでなく doc comment も⽣成 • GraphQL クエリ‧スキーマを⾒返す必要なし
All data from Google Cloud integr googleCloud: { /** Projects in Google Cloud */ projects: Array<{ /** Data on Google Cloud Storage cloudStorage: { /** All Google Cloud Storage bu buckets: Array<{ /** The bucket name */ name: string, /** The list of access contro acl: Array<{ entity: string, role: | "OWNER" | "READER" | "WRITER", }>, /** The IAM policy of the Goo iamPolicy: { • 情報後出しを避け、上から下に読めるように • T[] ではなく Array<T> • T | null ではなく Nullable<T>