handshake-org.github.io icon indicating copy to clipboard operation
handshake-org.github.io copied to clipboard

Flags in docs diverged from implementation

Open stp-ip opened this issue 5 years ago • 4 comments

The implementation in hsw-cli and most likely others moved from CamelCase to dash-case.

Example subtractFee -> subtract-fee.

This is not yet reflected within the docs: https://hsd-dev.org/api-docs/?shell--cli#send-a-transaction

stp-ip avatar Mar 10 '20 13:03 stp-ip

Oh sorry I didn't realize this in the chat, but this is actually convention across hsd and bcoin:

Similar to the chart on the top here: https://hsd-dev.org/guides/config.html

CLI params are always dash-case (--api-key=...) cURL and JS params are camel case (apiKey:...)

Maybe we should add an INTRODUCTION page to the API docs that clears up some of these issues.

pinheadmz avatar Mar 10 '20 14:03 pinheadmz

That makes sense. Knew that convention on the hsd side, but didn't think it would apply, when the docs show something different, but makes sense that they show that. Probably a note in general would be helpful. Especially, when examples are shown for CLI.

Closing anyway.

stp-ip avatar Mar 10 '20 14:03 stp-ip

Reopening to remind us we should add that intro page explaining basic conventions in the api-docs.

pinheadmz avatar Mar 12 '20 15:03 pinheadmz

TODO: Add to intro section at top of API docs that command line params are always --snake-case even if the API docs describe them they way are used in JavaScript constructors and cURL JSON data, which is camelCase

pinheadmz avatar Jan 27 '21 18:01 pinheadmz