-
Notifications
You must be signed in to change notification settings - Fork 58
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
Epic 3: Document API with an OpenAPI schema #125
Comments
@JaymePerlman @momartinjazz for visibility |
@JaymePerlman: Clarify:
Potential videos:
|
Capturing notes here. Mission statementUsers can read the “raw” OpenAPI docs since they’re written in YAML, but for a better experience, we want to build a human-readable set of docs. There are tools that consume the raw files and output formatted, easy-to-read information. Documentation should cover any HTTP error responses that are likely to happen and include instructions on how to remedy it. And some kind of message for the “200 success” code. Potential jump-startAs I suspected, we’re far from the first to try and solve this problem. For initial setup, we can just use the steps contained in this repo to generate and publish our “pretty” documentation on a GitHub Pages site. However, this site contains only one specification file, and we might end up needing more than one. As a bonus, it even contains a publish Action that we can modify to suit. Right now it runs an update every 10 hours (cron job) but we can probably change that to have it run when triggered instead of on a regular cadence. We could also change it to run more frequently, or hey, worst case it’s completely functional as-is. Having this basic infrastructure already in place frees up the hackathon to work on other things. Technical ReferencesIf folks are working in a codespace they can add the OpenAPI plugin. Here’s a good basic structure documentation site, but the official specification is pretty easy to follow. The root file must contain a few objects:
We probably want to have as many re-usable parts as possible. We should define a list of them, but there are definitely a few that leap to mind:
I don’t know enough to know if we need to define a security scheme (authentication/authorization), or if we’re even using any - that might be handled completely elsewhere, like by GitHub itself. Thoughts and TBDsCan we / do we document APIs we are using, not writing? Regarding API testing, we have a responsibility to document how to do it. But that's outside the scope of the API specifications, so where are we putting the SBS procedures for testing, and how are we getting it there? We only had API documentation before, so we've been solving for that problem, but now we have different kinds. OpenAPI is a specification for writing APIs, not just documenting them; are the devs on board with writing to this specification? Most parsers can handle one root file, and if we only document the APIs we write, we should only have one root file. If we decide to / can include APIs that have different root server sources, we'll need different files to capture them all. There are multiple documentation-generation tools available, but installing/configuring them may require some expert/developer time. The only one that seems to work with Jekyll, which means it's compatible with GH Pages, is jekyll-openapi But there are much more advanced options such as API explorer which includes an interactive API explorer. Awesome, if we can get it to work, but overkill? |
Epic NotesIntroductions and setting expectations@JaymePerlman introduced her research around this Epic 3
Actions or impacts
Actions to get started
Next steps
References
|
Description
Mission statement: Users can read the “raw” OpenAPI docs since they’re written in YAML, but for a better experience, we want to build a Pages site that intakes the raw files and outputs formatted, easy-to-read information.
Context
We currently document our API with manually updating Wiki pages, which are prone to inaccuracy and to becoming outdated. 😕
One alternative to consider would be documenting the API with a central OpenAPI schema file.
Side benefit: if desired, we can also then use additional Express middleware tooling for request validation. I have mixed feelings about this in practice based on past experiences but it is not unlikely that there are better tools available these days than a few years back. 🤷🏻♂️
With either of those approaches, we can then generate the documentation for it using the existing OpenAPI/Swagger tooling (see example demo page).
Spec
SMART exit criteria:
Links/Attachments for Reference
Considerations
Exit Criteria Implementation notes
gh-pages
branchgh-pages
branchHack out Tasks (9:15-10:30):
The text was updated successfully, but these errors were encountered: