clutter icon indicating copy to clipboard operation
clutter copied to clipboard

Proposal: Augment dna.json to support clearer auto-generated api documentation

Open neonphog opened this issue 6 years ago • 1 comments

Please see the changes to dna/dna.json:

  • Addition of ReturnType to Functions items. Note holochain currently returns text/plain content-type for all calls (even if they return json data), hence everything for clutter marked as string.
  • Addition of InputSchemaFile to Functions items that have a CallingType of json. This gives us more information about the expected parameters.
  • Addition of OutputSchemaFile to Functions items that have a ReturnType of json. Unused at the moment (given holochain always returns text/plain) but can in the future give us an indication of output data format.
  • Addition of Description to Functions items. This is a string (potentially markdown) that can give a more verbose indication of what functions do / how to use them.

Notes on accessing the api-docs:

  • Works with the development server npm start... simply navigate to http://localhost:3000/clutter-api-docs.html
  • Does NOT work with the production build, hcd/hcdev hosted ui site. Afaik we would need to eject the create-react-app environment to get the service-worker et all to stop overwriting the path with index.html. If anyone has another solution (ejecting adds a big configuration management overhead) would much appreciate it.
  • You can also just navigate to the docs with file://, but you'll need some cors fixes: https://github.com/holochain/holochain-proto/pull/741

neonphog avatar Jun 05 '18 18:06 neonphog

To add to that I would also add the Description to Entries. And For Entries of type links, I would add more fields to describe the base, link and tags like I did in HoloChess.

ddd-mtl avatar Jun 05 '18 18:06 ddd-mtl