rpc: Fail to return undocumented or misdocumented JSON
Summary:
Avoid documentation issues by detecting them at runtime, gated by a flag to avoid throwing errors in production for doc issues.
The flag is currently disabled even in tests, where is should be enabled after the current issues have been fixed.
Backport of core#23083 and core#25161.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Subscribers: PiRK
Differential Revision: https://reviews.bitcoinabc.org/D16252