Skip to content
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

RPC Documents Consolidation #6995

Merged

Conversation

ShahanaFarooqui
Copy link
Collaborator

@ShahanaFarooqui ShahanaFarooqui commented Jan 16, 2024

This PR will generate doc/lightning-*.md file contents for rpc commands. It will get the information from consolidated doc/schemas/lightning-*.json and use it to generate markdown for RPC commands.

Changelog-Changed: Documentation: great documentation rewrite, all reference pages now generated from the fully-tested JSON schemas and include examples.

@ShahanaFarooqui ShahanaFarooqui added this to the v24.02 milestone Jan 16, 2024
@ShahanaFarooqui ShahanaFarooqui force-pushed the docs-consolidation branch 2 times, most recently from f194d79 to 00cc09d Compare January 16, 2024 05:45
@ShahanaFarooqui ShahanaFarooqui marked this pull request as draft January 16, 2024 05:46
@ShahanaFarooqui ShahanaFarooqui self-assigned this Jan 16, 2024
@ShahanaFarooqui ShahanaFarooqui force-pushed the docs-consolidation branch 4 times, most recently from 73f3159 to f0f853f Compare January 17, 2024 21:58
@cdecker
Copy link
Member

cdecker commented Jan 18, 2024

@ShahanaFarooqui, this is tagged for version v24.02. I plan to call a feature freeze on the 29th, and given that this PR is still drafted I wanted to ask whether you are planning on finalizing this by then, or if more time is needed.

@ShahanaFarooqui
Copy link
Collaborator Author

@cdecker I need some help in fixing the CI and I am hoping to be able to do that around Jan 26th. I will update the milestone if it is not ready by then.

@ShahanaFarooqui ShahanaFarooqui force-pushed the docs-consolidation branch 17 times, most recently from 00ff825 to b5ee65e Compare January 24, 2024 06:01
rustyrussell and others added 10 commits March 18, 2024 15:00
In general, results should always be an object, so we can add new fields
later (e.g. warnings!).  But we violated this for "stop", and when "recover"
used the same infrastructure, it started doing the same thing.

I'm assuming nobody cares, so we don't need to do a deprecation cycle.

Changelog-Changed: JSON-RPC: `stop` and `recover` now return a JSON object (not a raw string!) like every other command does.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We actually use this in multiple places for requests.  The key
difference between this and msat is what we do when presented with a
raw number!  I prefer insisting on explicit suffixes, for this reason,
but at least this will document the field correctly!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Some rpc commands did not have their corresponding *.request.json files to generate the consolidated json
Adding missing *.schema.json files for rpc commands to create consolidated json files.
Updating and deleting other as per requirement.
Added descriptions for rpc command parameters

This also performs the following fixes:
1. delforward parameters are compulsory (required).
2. disableinvoicerequest request added `added` field.
3. invoice request order fixed (label then description, not vice-versa!).
4. listpeers log levels are a proper enum
5. description parameter documented for sendonion requests.
6. deprecatred amount_msat removed from sendpay request.
7. sendpay request partid type fixed to u64 (was u16!)
8. sendpay request localinvreqid type tightened to hash (was hex)
9. sendpay request payment_metadata and description fields documented.
10. sendpsbt request reserve type fixed to u32 (was boolean)
11. utxopsbt request satoshi type fixed to msat_or_all (was msat)
12. withdraw request parameter satoshi is compulsory (required)
13. fundchannel_start request amount is sat, not msat_or_all.
14. openchannel_init request amount is sat, not msat
15. openchannel_init close_to is a string, not hex.
16: invoice labels can be strings OR numbers.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
- Makes emergency schema stricter
- Fixes some formatting
This commit will remove parameter descriptions from RPC markdown but we will fix it in next commits by reading these descriptions directly from json.

- Removing parameter description text
- Adding/removing newlines for cleaner formatting
- Adding ERRORS title wherever needed
- Updating titles for consistency
- Adding resources links
Merge information from `*.request.json` & `*.schema.json`. Also consolidate remaining details from `*.md` files and create a single file in schemas folder.
cln-rpc/src/model.rs Outdated Show resolved Hide resolved
- Update `make doc-all` script
- `fromschema.py` script
    - Updated to generate whole doc/lightning-*.md via doc/schemas/lightning-*.json file
    - Updated to print request params
    - Added `oneOfMany` condition for request params
    - Added `pairedWith` condition for request params
    - Added `dependentUpon` condition for request params
    - Updated for pre and post_return_value for response
    - Hiding `hidden` fields
    - `descriptions` are array now
    - Unified gaps between titles
    - Added default key-value pair

- script: msggen, sql-schema, listconfig and pyln-testing script updates

This does not add created markdowns for cleaner review. We will add the markdown files in a separate commit.
- Updated doc/Makefile for generating schemas/lightning-sql.json
    - Read the lightning-sql template from schemas/lightning-sql-template.json
    - Generate sql tables data and merge it with json object read from above template
    - Save final merged object in schemas/lightning-sql.json
- Updated doc/Makefile to auto generate lightning-sql.7.md and lightning-sql.7
- Deleted schemas/lightning-sql.json and adding it into .gitignore
- Added lightning-sql specific titles in the fromschema.py script
- Fixed test_sql by changing the sequence for listpeerchannels `reestablished` field
- Ignoring lightning-sql.json for msggen schema.json because it is auto generated by sql plugin and lightning-sql-template.json.
This PR will generate doc/lightning-*.md file for rpc commands. It will get the information from consolidated doc/schemas/lightning-*.json file and use it to generate markdown file for RPC commands.

Changelog-Changed: Documentation: great documentation rewrite, all reference pages now generated from the fully-tested JSON schemas and include examples.
@rustyrussell rustyrussell merged commit 9b83b8b into ElementsProject:master Mar 19, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants