fix(schema): allow null values for referenceTable and lookup in app f…#409
Open
yuto-0315 wants to merge 1 commit into
Open
fix(schema): allow null values for referenceTable and lookup in app f…#409yuto-0315 wants to merge 1 commit into
yuto-0315 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Kintone の
get-form-fieldsAPI は、関連レコード一覧(REFERENCE_TABLE)やルックアップ(LOOKUP)の構成情報が設定されていない場合や権限が制限されている場合に、nullを返すことがあります。現在の Zod スキーマでは
nullを許容していないため、これらのフィールドが含まれるアプリでツールを実行すると、MCP バリデーションエラー(-32602)が発生していました。What
properties-parameter.tsおよびfield-properties.tsの Zod スキーマにおいて、referenceTableとlookupプロパティに.nullish()を追加し、nullを受け入れられるようにしました。.transform()を使用して、受け取ったnullを内部的にundefinedへ変換するようにしました。これにより、PropertiesForParameter型(Kintone SDK の型定義)との互換性が保たれ、add-form-fieldsなどの他ツールでビルドエラーが発生しないようになっています。How to test
referenceTableがnullで返る状態のアプリ)に対してkintone-get-form-fieldsツールを実行し、バリデーションエラーが発生しないことを確認します。pnpm buildまたはpnpm build:mcpbを実行し、TypeScript のコンパイルエラーが発生しないことを確認します。Checklist
pnpm lintandpnpm teston the root directory.