Skip to main content

Replied to a post on github.com :

It'd be good to automate this somewhat, if only because folk are lazy and it'd be good if there was always a current list (as well as a current list on each install, which is going to change depending on what plugins are installed and active).

I wonder whether we can make use of the fact that all api endpoints are going to be children of /idno/core/page to generate some of this automatically?

At the very least one should be able to derive URLs and methods from the page handler, so perhaps we could have a "document" switch which causes api endpoints to be outputted somewhere, perhaps as part of the unit tests and build process.

Parameters are tricky. A way I built APIs in other systems was that parameters were actually defined in the function header, and the declaration extracted valid arguments via reflection, which might be worth thinking about in the long run, but it's probably not worth re-engineering the whole API ;)

Anyway, just spitballing here...