-
Notifications
You must be signed in to change notification settings - Fork 454
Add swagger yaml for API documentation - Closes #5459 #5462
Conversation
6cde97e
to
4cfb29b
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.
LGTM, minor comments
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.
Few overall changes:
- Whenever you refer unix timestamp must mention it as unix timestamp in seconds
- All collections endpoints must return collection response
- All endpoints must have a
meta
object, for collection it will contain pagination information, for rest, it will be an empty object. - I also have seen in few other APIs to use
result
key instead ofdata
. If you feel feasible please change that as well.
description: | | ||
Current block height of the node. | ||
Represents the current number of blocks in the chain on the node. | ||
chainMaxHeightFinalized: |
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.
finalized height will always refer to the highest value, so it can be just used as finalizedHeight.
chainMaxHeightFinalized: | |
finalizedHeight: |
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.
I think this was the conclusion of what we called this value in the endpoint.
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.
Conclusion where? I don't remember any discussion around this topic.
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.
the name is exactly the same as in LIP https://github.com/LiskHQ/lips/blob/master/proposals/lip-0014.md#computing-prevotes-and-precommits.
and when this property was added, it was discussed at that time if I remember correctly
What was the problem?
This PR resolves #5459
How was it solved?
/delegates
and/forgers
are not generic enough at the moment.This might require further change depending on the direction
How was it tested?
Copy paste the yaml file into https://editor.swagger.io/ and check the definition