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

Generate static documentation of REST API based on existing OpenAPI specification #444

Closed
uguy opened this issue Oct 4, 2022 · 7 comments

Comments

@uguy
Copy link
Member

uguy commented Oct 4, 2022

Bonita OpenAPI specification lives in this repository https://github.com/bonitasoft/bonita-openapi.
But a kind of duplicate lives in bonita-doc repository as static asciidoc file (https://github.com/bonitasoft/bonita-doc/blob/2022.2/modules/api/pages/rest-api-overview.adoc).

This situation can lead to a desynchronization between the two API documentations 😟 .

Developer often ask for an OpenAPI spec of Bonita REST APIs. (Some might want to generate client code from spec, so yaml format exposure is required).

Every other want to browse/search documentation for their implementations (required to be SSO friendly).

Important: OpenAPI specification has its own lifecycle (not bound to Bonita versions). This means that the same documentation is used for many Bonita versions ( = many documentation versions)

Two options:

  • Generate AsciiDoc sources to be processed as any other Antora page in bonita-doc repository (one page per Bonita versions but not ideal) (PoC in this PR feat(rest-api): static api doc bonita-doc#2181)
  • Generate a separated site hosting API documentation and point to it from Bonita documentation (using classic Redoc customization)

Useful links:

Formerly requested with #39

@uguy
Copy link
Member Author

uguy commented Oct 7, 2022

@uguy
Copy link
Member Author

uguy commented Oct 7, 2022

Generated static html page with Redoc hosted here as a sample : https://bonita-api-doc.netlify.app/
The trouble is that the static generator don't handle markdown description whereas Redoc Reactjs component does (but not SEO friendly)

More control is available from https://redocly.com/docs/api-reference-docs/guides/on-premise-cli-build/ but only for enterprise plan 😬

@uguy
Copy link
Member Author

uguy commented Oct 7, 2022

Spec versioning (hence multiple doc version hosting) should be supported. For now, there were no API break but this will come in future Bonita releases.

@uguy
Copy link
Member Author

uguy commented Oct 24, 2022

An interesting option seems to be hosting Redoc pages in a dedicated site referenced by main Bonita documentation.
We would need to :

  • generated static page per spec version (with redoc-cli)
  • host different version of the spec (generated doc)
  • offer a way to the user to change/target doc version
  • add analytics to follow usage
  • generate a local dev preview, publish a preview on PR push
  • automated publication of new tag (tagged content may contain the html doc to be hosted)
  • Filter old tag because "out of support"
  • handle default route : / , /latest , /x.x.x => latest tagged doc - /y.y.y => y.y.y spec doc version

and also :

  • Be clear on compatibility matrix between OpenAPI spec version and bonita versions !

@uguy
Copy link
Member Author

uguy commented Oct 24, 2022

Question remains, do we orchestrate deployment from a separate repository and keep all html/site stuff there and only the spec in bonta-openapi repository ? Or do we try to merge and handle all this stuff from the existing repository (keeping close editing and rendering)

@uguy
Copy link
Member Author

uguy commented Oct 25, 2022

PoC in progress in OpenAPI spec repository bonitasoft/bonita-openapi#60

@benjaminParisel
Copy link
Contributor

This issue is closed with the work around this subject. We created a repository https://github.com/bonitasoft/bonita-rest-documentation-site and the production site is available here

I will close this issue. If some issue is found, please open it on dedicated GitHub repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants