Skip to content

Publish MTA REST API reference to GitHub Pages - #1886

Draft
boyan-velinov wants to merge 1 commit into
masterfrom
improve-api-docu
Draft

Publish MTA REST API reference to GitHub Pages#1886
boyan-velinov wants to merge 1 commit into
masterfrom
improve-api-docu

Conversation

@boyan-velinov

Copy link
Copy Markdown
Contributor

Replace the exhausted SwaggerHub-hosted API docs with a self-hosted interactive reference on GitHub Pages, auto-published from source control.

A new workflow (publish-docs.yml) triggers on changes to the generated API specs (mtarest.yaml, mtarest_v2.yaml) and writes per-version Swagger UI pages plus the raw YAML into the gh-pages branch under /api/. The existing landing page is left untouched via a scoped git add.

  • Swagger UI (swagger-ui-dist 5.32.11) is fetched at publish time and SHA-256 verified before vendoring; no CDN dependency, no committed blob.
  • A version folder is keyed off info.version; content changes without a version bump fail the build unless the commit carries [docs-republish].
  • info.version is validated against a semver allowlist before it is used as a path segment or interpolated into generated HTML.
  • Page markup is kept in .github/pages-templates/ and rendered with literal placeholder substitution, keeping the workflow readable.
  • Double-link between the landing page and the docs: generated pages carry a Home link back to the site root; the landing page's existing API link goes live once /api/ is published.

Point the README at the new location:
https://cloudfoundry.github.io/multiapps-controller/api/

Replace the exhausted SwaggerHub-hosted API docs with a self-hosted
interactive reference on GitHub Pages, auto-published from source control.

A new workflow (publish-docs.yml) triggers on changes to the generated
API specs (mtarest.yaml, mtarest_v2.yaml) and writes per-version Swagger
UI pages plus the raw YAML into the gh-pages branch under /api/. The
existing landing page is left untouched via a scoped `git add`.

  - Swagger UI (swagger-ui-dist 5.32.11) is fetched at publish time and
    SHA-256 verified before vendoring; no CDN dependency, no committed blob.
  - A version folder is keyed off info.version; content changes without a
    version bump fail the build unless the commit carries [docs-republish].
  - info.version is validated against a semver allowlist before it is used
    as a path segment or interpolated into generated HTML.
  - Page markup is kept in .github/pages-templates/ and rendered with
    literal placeholder substitution, keeping the workflow readable.
  - Double-link between the landing page and the docs: generated pages carry
    a Home link back to the site root; the landing page's existing API link
    goes live once /api/ is published.

  Point the README at the new location:
  https://cloudfoundry.github.io/multiapps-controller/api/
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant