Skip to content

fix: CopyPageButton on docs + array body coercion in API Reference#2973

Merged
Ishavyas9 merged 1 commit into
LambdaTest:stagefrom
sakshamarora-arch:fix/copy-page-array-coercion-stage
May 22, 2026
Merged

fix: CopyPageButton on docs + array body coercion in API Reference#2973
Ishavyas9 merged 1 commit into
LambdaTest:stagefrom
sakshamarora-arch:fix/copy-page-array-coercion-stage

Conversation

@sakshamarora-arch
Copy link
Copy Markdown
Contributor

Summary

  • CopyPageButton on docs pages: The "Copy Page" button (copy as Markdown, open in ChatGPT/Claude/Perplexity, connect MCP) was only showing on API Reference and FAQ pages but not on Support Docs. Root cause: index.tsx overrides index.js in Docusaurus, and the .tsx file was missing the CopyPageButton component.
  • Array body field coercion: API Reference Try It modal and code examples were sending array-type request body fields (e.g. job_ids, tags, device) as plain strings instead of JSON arrays, causing 400 errors from APIs. Added coerceBodyValue() utility that supports both JSON syntax (["a","b"]) and comma-separated input (a, b). 16 endpoints across 5 APIs affected (Selenium Automation, App Automation, User Management, Test Manager, Analytics/RCA). Also added placeholder hint on array fields in Try It modal.

Test plan

  • Open any Support Docs page → verify "Copy Page" button appears in top-right
  • Open API Reference → Try It on an endpoint with array body fields (e.g. Test Manager "Create Project" → tags field)
  • Enter t1, t2 → verify request sends ["t1", "t2"] not "t1, t2"
  • Enter ["t1", "t2"] → verify same result
  • Verify code examples (cURL/Python/JS) show [] for array fields by default
  • Verify non-array endpoints still work as before

🤖 Generated with Claude Code

… API Reference

- CopyPageButton was missing on Support Docs pages because index.tsx
  (which takes precedence over index.js in Docusaurus) did not include it.
- API Reference Try It modal and code examples were sending array-type
  request body fields as strings instead of JSON arrays, causing 400
  errors. Added coerceBodyValue() utility that handles both JSON syntax
  and comma-separated input. Affects 16 endpoints across 5 APIs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Ishavyas9 Ishavyas9 merged commit 98236b1 into LambdaTest:stage May 22, 2026
1 check failed
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.

2 participants