-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON schemas in doc/ (only some commands so far) #4501
JSON schemas in doc/ (only some commands so far) #4501
Conversation
f70d8ad
to
459c07c
Compare
4cea97e
to
37e14c6
Compare
37e14c6
to
36a7d7a
Compare
It needs to be defined before we include them. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
36a7d7a
to
a65fd7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great improvement, I don't envy you for having to dig through all these commands, but the final result is just awesome 👍
ACK a65fd7f
the amount the destination received, in "NNNmsat" format. | ||
|
||
These three can all be extracted from *bolt11*, hence are obsolete. | ||
[comment]: # (GENERATE-FROM-SCHEMA-START) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very interesting, I didn't know this worked in md.
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation made this diff a bit hard to read, but can be formatted in a new pass later.
For markdown, there's no simple comment prefix: we need a postfix too. We also need to use "" since we want to use ' in some of the Makefiles in future when V=1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Nested lists don't work (it puts the .RS at the end of the line instead of on a line by itself), so we sed it. refi64/mrkd#4 This fixes up formatting on a number of existing pages.. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
result should *always* be an object. This allows it to add fields without breaking the API. A command which returns "result" as a string is living in sin. This changes one of the two callers of "command_success_str". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is hard to parse, and not extensible in future, and disagrees with the man page (and caught by schema). Technically this is an API break, but it can't be done neatly anyway and it's unlikely someone is relying on this today :( Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: JSONRPC: `autocleaninvoice` now returns an object, not a raw string.
As mentioned in previous commits: "result" must be an object, and anything else is an antipattern. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Undocumented (caught by json schema!) if we discard channel because it wasn't open yet, then close returned the empty object. Make it return a new type in this case. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSONRPC: `close` returns `type` "unopened" if it simply discards channel instead of empty object.
Otherwise our schema is pretty meaningless, since invalid decodes can have missing "required" fields. Also fix a typo "blinded_payindo". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Experimental: JSON-RPC: `decode` now gives a `valid` boolean (it does partial decodes of some invalid data).
This adds our first (basic) schema, and sews support into pyln-testing so it will load schemas for any method for doc/schemas/{method}.schema.json. All JSON responses in a test run are checked against the schema (if any). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…th schema. It can also be run standalone for debugging. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We start with the listpays manpage. Which is now complete! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
addgossip, check, createinvoice, createonion. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
One of the more complex ones. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…annel, fundchannel_cancel, fundchannel_complete, fundchannel_start, fundpsbt, getinfo, getlog, getroute. We also add a test for getlog, since it was never called by the testsuite. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
a65fd7f
to
2ab8043
Compare
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rebase and fixed obv typo in Makefile. Ack b22e8ac |
28b0b06 pay: 0.10.0 fix incompatible response (elsirion) Pull request description: A few fields of the pay response were removed and one added since this crate was last updated. This PR fixes the pay command. Others might be incompatible too, but would require more extensive testing. Easy testing will be possible once ElementsProject/lightning#4501 lands. ACKs for top commit: laanwj: Code review ACK 28b0b06 Tree-SHA512: 184ea4665425185c13a61639aac5660ffeec42446f19342de8da37cb49a17de0caa9f81d3255ceb6e3f77f52a97bfb5936f402150b1e64793cbf4f1c263e3559
This is the result of my json schema adventures so far; we'll see what it looks like when I've done commands
DH through Z :)It both checks the schema validity on every command during a test run, and generates documentation for us.
Inspired by #4286