test: validate JSON in RPC help examples #36003

pull qtjg wants to merge 3 commits into bitcoin:master from qtjg:mb/issue-35864-rpc-help-json changing 9 files +25 −15
  1. qtjg commented at 2:55 AM on August 18, 2026: none

    Resolves bitcoin/bitcoin#35864

    Summary

    HelpExampleRpc builds JSON-RPC curl examples from literal argument strings. This change adds a functional-test guard that parses every generated curl payload as JSON, preventing future malformed examples from being published in RPC help text.

    The guard exposed and this PR fixes malformed examples across blockchain, networking, mempool, wallet, and wallet-backup RPC help. The fixes cover missing commas, bare string placeholders, a JSON address-array example, and Windows path escaping.

    Testing

    • python3 -m py_compile test/functional/rpc_help.py
    • rpc_help.py functional test: passed
    • ctest --test-dir build --output-on-failure --parallel 2: 100% passed, 0 failed out of 372 tests; 1 test skipped (script_assets_tests)
    • Bitcoin Core build with wallet, IPC, ZMQ, and tests enabled: passed

    The regtest RPC smoke workflow was also run separately with local-only disposable state; it mined 101 blocks, validated a signed transaction with testmempoolaccept, confirmed it, and shut the daemon down automatically.

  2. test: validate JSON in RPC help examples
    Resolves bitcoin/bitcoin#35864
    
    Add a runtime check that parses every generated HelpExampleRpc curl payload as JSON, then fix the invalid examples found in the RPC, wallet, and mempool help text.
    58a349347f
  3. DrahtBot added the label Tests on Aug 18, 2026
  4. DrahtBot commented at 2:55 AM on August 18, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36003.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. fix: validate wallet RPC help JSON examples
    Complete the issue #35864 fix set with valid quoting, separators, address-array syntax, and Windows path escaping in wallet-related RPC help.
    14d6c5ece1
  6. test: validate JSON in RPC help output
    Add a runtime JSON parse check for every generated HelpExampleRpc curl payload so future malformed RPC help examples fail the functional test.
    16a279991f
  7. maflcko commented at 5:10 AM on August 18, 2026: member

    ai slop

  8. maflcko closed this on Aug 18, 2026

  9. qtjg deleted the branch on Aug 18, 2026
  10. qtjg restored the branch on Aug 18, 2026
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-21 04:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me