Update developer notes with RPC response guidelines #11135

pull promag wants to merge 1 commits into bitcoin:master from promag:2017-08-rpc-response-notes changing 1 files +5 −0
  1. promag commented at 2:55 PM on August 25, 2017: member

    No description provided.

  2. [doc] Add RPC response notes 62ecce75e4
  3. jnewbery commented at 6:36 PM on August 25, 2017: member

    ACK - seems like a reasonable suggestion. Agree that this should be a SHOULD rather than a MUST.

  4. fanquake added the label Docs and Output on Aug 25, 2017
  5. mess110 commented at 11:33 PM on August 26, 2017: contributor

    The main reason I can think of not to return a JSON object is if it returns something raw like a key or a number. Maybe there are also backward compatibility reasons why non JSON output is returned. Are there any other reasons?

    Wouldn't it make it easier for clients to always expect a JSON object in the response? It would be future proof as well.

  6. laanwj commented at 8:35 AM on August 28, 2017: member

    Backward compatibility is a strong reason. We don't change existing interfaces unless there is a a good reason, and just conforming to a developer-notes item is not one.

    Also, it's slightly easier to use from the command-line (especially scripts) with bitcoin-cli if something returns a bare value.

  7. promag commented at 10:48 AM on August 28, 2017: member

    @laanwj the guideline is Try to make the RPC response a JSON object, it's not agains bare values. Beside that, I would bet RPC is mostly used with foreign client libraries than with bitcoin-cli.

  8. laanwj commented at 12:39 PM on August 28, 2017: member

    I would bet RPC is mostly used with foreign client libraries than with bitcoin-cli

    That's not the point, isn't it? despite a bet what use form is more common, many people are using bitcoin-cli as a command line client.

  9. promag commented at 1:45 PM on August 28, 2017: member

    No it isn't for sure, but I think we shouldn't have bitcoin-cli in mind when deciding API interface.

    As for bitcoin-cli, I've previously suggested to have something like -rpcoutput=... to ease in those cases, but that's another topic.

    Do you think I should improve the guideline?

  10. promag renamed this:
    Add RPC response notes
    Update developer notes with RPC response guidelines
    on Aug 29, 2017
  11. luke-jr approved
  12. luke-jr commented at 7:00 AM on September 2, 2017: member

    ACK

  13. MarcoFalke commented at 8:50 AM on September 2, 2017: member

    ACK 62ecce7

  14. laanwj merged this on Sep 6, 2017
  15. laanwj closed this on Sep 6, 2017

  16. laanwj referenced this in commit 21e2f2f799 on Sep 6, 2017
  17. PastaPastaPasta referenced this in commit a9a3ee7d27 on Sep 20, 2019
  18. PastaPastaPasta referenced this in commit e41b290bf6 on Sep 23, 2019
  19. PastaPastaPasta referenced this in commit eefbd448fd on Sep 23, 2019
  20. PastaPastaPasta referenced this in commit cc560b9ce7 on Sep 24, 2019
  21. PastaPastaPasta referenced this in commit 1b255fc16b on Nov 19, 2019
  22. PastaPastaPasta referenced this in commit 38a3868fce on Nov 21, 2019
  23. PastaPastaPasta referenced this in commit ce633a7490 on Dec 9, 2019
  24. PastaPastaPasta referenced this in commit ced462ec9c on Jan 1, 2020
  25. PastaPastaPasta referenced this in commit 0bce77c09e on Jan 2, 2020
  26. PastaPastaPasta referenced this in commit 06760febdd on Jan 2, 2020
  27. PastaPastaPasta referenced this in commit 10f7c5f066 on Jan 2, 2020
  28. ckti referenced this in commit c094118574 on Mar 28, 2021
  29. gades referenced this in commit 69487b2ffc on Jun 30, 2021
  30. DrahtBot locked this on Sep 8, 2021

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-04-22 00:15 UTC

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