steem icon indicating copy to clipboard operation
steem copied to clipboard

API Schema Generation

Open youkaicountry opened this issue 7 years ago • 1 comments

Output automatically generated schema for each API call.

Acceptance Criteria:

  • JSON formatted output
  • Output should include call, params, and return

youkaicountry avatar Nov 13 '18 16:11 youkaicountry

The API itself is already self-describing.

There are two api calls, get_methods and get_signature. get_methods returns a list of all registered API calls on the node and get_signature returns default initialized arg and return types for a particular method. Using these you can generate a JSON schema for the all available API calls on a particular node.

For most API calls, this adequately describes the call. The only place this fails short are arguments that include opaque types such as static_variant, variant, vector, flat_map, etc. This also does not return any primitive type information, although it may be possible to leverage information already captured by FC's reflection to do this.

mvandeberg avatar Nov 13 '18 16:11 mvandeberg