Skip to content

feat: support json v2 ephemeral cards - #4

Draft
alick-liming wants to merge 4 commits into
feat/feishu-ephemeral-card-v2from
codex/feishu-ephemeral-card-v2
Draft

feat: support json v2 ephemeral cards#4
alick-liming wants to merge 4 commits into
feat/feishu-ephemeral-card-v2from
codex/feishu-ephemeral-card-v2

Conversation

@alick-liming

@alick-liming alick-liming commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Allow ephemeral message requests to send JSON 2.0 through CardV2 json.RawMessage, while preserving Card *MessageContentCard for V1 callers.
  • Serialize exactly one card object, reject conflicting V1/V2 inputs, and omit an unset card. Cover all four cases with tests.
  • Repair outdated test fixtures: initialize method options in all seven request-parser cases and remove the obsolete Range field from the whole-file download test. Existing assertions remain intact.

Validation

  • go test . -run '^Test_Request$' -count=1 — passed; reproduced the nil method-option panic before the fixture fix.
  • go test . -run '^TestSendEphemeralMessageReq' -count=1 — passed.
  • go test ./... -run '^$' -count=1 — all test packages compile.
  • go vet ./... — passed.
  • go build ./... — passed.
  • go mod verify — passed.
  • git diff --check — passed.
  • go test ./... -count=1 -timeout=60s — the root, card, internal, and larkext packages passed. The test package reached the explicit 60-second limit in Test_CoreHR_Sample_Failed/response_is_failed while requesting a tenant token from Feishu. This is not a full-suite pass; external integration validation remains outstanding.

Scope / Notes

  • Production changes are limited to ephemeral card input and serialization. The request-parser and download fixes only change tests.
  • The API field is a manually maintained fork extension. This repository has no corresponding API generator/spec or local regeneration entry point; preserve CardV2 when importing regenerated SDK code. This is a maintenance note, not a demonstrated failure in the current build.
  • The existing scientific-notation parser fix and version constant update in the fork remain included.

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