Skip to content

Conversation

@kodacme
Copy link

@kodacme kodacme commented Jan 23, 2026

Why

kintone REST APIのレコード更新操作において、サブテーブルの既存行のidを指定することで既存行を更新することが可能ですが、本クライアントにおける操作ではidが出力されないことにより常に削除&新規行登録となっていました。サブテーブルのidもシリアライズすることで既存行の更新が可能となります。

ref: https://cybozu.dev/ja/kintone/docs/rest-api/records/update-record/#notes-table

What

  • FieldType.SUBTABLE のシリアライズを修正
  • FieldType.SUBTABLE のテストケースを追加

How to test

修正前に追加したケースが失敗することを確認した

kintone_test_fail

✅ 修正後にテストが全て成功することを確認済み

Checklist

  • Read CONTRIBUTING.md at the repository.
  • Updated documentation if it is required.
  • Added/updated tests if it is required. (or tested manually)

Copilot AI review requested due to automatic review settings January 23, 2026 22:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where subtable row IDs were not included in the serialized JSON output when updating kintone records. Previously, this caused all subtable updates to delete existing rows and create new ones instead of updating the existing rows in place. By including the ID field in the serialized output, the kintone REST API can now properly identify and update existing subtable rows.

Changes:

  • Modified RecordSerializer.writeSubtable() to conditionally serialize subtable row IDs when present
  • Added comprehensive test coverage for subtable serialization with IDs, without IDs, and mixed scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/java/com/kintone/client/RecordSerializer.java Added conditional serialization of subtable row IDs (lines 256-258) to support updating existing rows
src/test/java/com/kintone/client/RecordSerializerTest.java Added two new test cases: one testing rows with IDs and another testing a mix of rows with and without IDs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kodacme
Copy link
Author

kodacme commented Jan 27, 2026

@chihiro-adachi @nameless-mc @shabaraba
突然のメンション失礼します。お忙しいところすみません。
こちらのPullRequestについてお時間ある際にレビューいただけると嬉しいです。必要な修正などあれば遠慮なく教えてください。
現在開発中のPRJで本クライアントを使用しておりましてこちらの機能修正を必要としています。次回のリリース予定時期についてもお聞きしたいです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant