-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for inline, manual documentation of Endpoints in definition. #1460
Conversation
I'm in support of this change, and it looks good to me! |
2c46ca2
to
7881c37
Compare
@pobocks going to let the tests pass, then will merge. @lmcglohon @cdibella and I discussed the possibility of having the Python tab (well, once someone adds the first Python example and there is a Python tab) default to a "no example has been provided for this endpoint yet, please consider providing one" sort of blurb, but that can be a future enhancement. Thanks for this. |
Very welcome! Re: the Python tab thing, if that's something that's desirable, I'm happy add it in, I'm gonna be in there documenting at least a few endpoints so there are examples, anyway. Also, I wanna re-up the question of whether we should come up with a criteria for Python examples, like, I think the following questions ought to be answered maybe? A) Should it assume dependencies are available, or use stdlib only? I think in either case, I'd want to add an explainer to the docs re: what we're doing (and maybe some boilerplate that we don't want to repeat per-example, i.e. where to get whichever library and how to import it and authenticate, in the authentication section. |
Description
These changes make it possible to add a documentation block (in markdown) and an example in any language supported by Rouge to an Endpoint.
Motivation and Context
The auto-generated API docs are a useful resource, but are in many cases unhelpful, misleading, or downright inaccurate. Shell examples are wrong more often than right for endpoints that aren't resources or simple collections of same-type resources. At the same time, they're the best we have, and replacing them with something better will take time and effort.
This code allows for manual docs to be inserted, while falling back to the existing generated docs.
How Has This Been Tested?
I added calls to
Endpoint#documentation
andEndpoint#example
in the spec for the REST helper.Types of changes
Checklist: