clutter
clutter copied to clipboard
Proposal: Augment dna.json to support clearer auto-generated api documentation
Please see the changes to dna/dna.json:
- Addition of
ReturnTypetoFunctionsitems. Note holochain currently returnstext/plaincontent-type for all calls (even if they return json data), hence everything for clutter marked asstring. - Addition of
InputSchemaFiletoFunctionsitems that have aCallingTypeofjson. This gives us more information about the expected parameters. - Addition of
OutputSchemaFiletoFunctionsitems that have aReturnTypeofjson. Unused at the moment (given holochain always returnstext/plain) but can in the future give us an indication of output data format. - Addition of
DescriptiontoFunctionsitems. 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
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.