Skip to content
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

Merged
merged 8 commits into from
Feb 12, 2019

Conversation

pobocks
Copy link
Contributor

@pobocks pobocks commented Jan 31, 2019

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 and Endpoint#example in the spec for the REST helper.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@p-galligan
Copy link

I'm in support of this change, and it looks good to me!

@lmcglohon
Copy link
Contributor

lmcglohon commented Feb 12, 2019

@pobocks I figured out how to add information using the documentation piece but I am not sure how to add information using the example piece. Can you please add more information on how to use the example piece?

@pobocks Nevermind - I got it to work

@lorawoodford
Copy link
Contributor

@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.

@lorawoodford lorawoodford merged commit ad4706b into master Feb 12, 2019
@lorawoodford lorawoodford deleted the endpoint_docs branch February 12, 2019 21:42
@lmcglohon lmcglohon added this to the 2.6.0 milestone Feb 12, 2019
@pobocks
Copy link
Contributor Author

pobocks commented Feb 13, 2019

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?
B) requests or asnake?

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.

@cdibella cdibella added the community code contributed by community members not on or contracted by the ArchivesSpace program team label Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community code contributed by community members not on or contracted by the ArchivesSpace program team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants