Skip to content

feat(dashboard): add OpenAPI spec generation and Swagger UI#161

Merged
coopernetes merged 3 commits intomainfrom
feat/openapi-spec
Apr 15, 2026
Merged

feat(dashboard): add OpenAPI spec generation and Swagger UI#161
coopernetes merged 3 commits intomainfrom
feat/openapi-spec

Conversation

@coopernetes
Copy link
Copy Markdown
Owner

@coopernetes coopernetes commented Apr 15, 2026

Summary

  • Adds /api/openapi.json and /api/openapi.yaml endpoints generated at startup from Spring MVC route metadata (RequestMappingHandlerMapping)
  • Adds a Swagger UI browser at /swagger-ui (redirects to /swagger-ui.html) backed by a custom HTML page that bypasses swagger-initializer.js (no petstore)
  • Uses swagger-core-jakarta + Spring's own routing introspection — no springdoc, no Spring Boot, no JAX-RS dependency
  • WebJar paths are versioned and injected via Gradle token expansion at build time; app version read from version.properties (also Gradle-expanded)
  • All 11 controllers annotated with @Tag and @Operation for a clean spec grouped by: System, Auth, Users, Repos, Push, Providers, Profile, Admin

API

Method Path Description
GET /api Version and API docs link (public)
GET /api/openapi.json OpenAPI 3.0 spec (JSON, public)
GET /api/openapi.yaml OpenAPI 3.0 spec (YAML, public)
GET /swagger-ui Redirects to Swagger UI browser

Test plan

  • ./gradlew :git-proxy-java-dashboard:compileJava -PskipFrontend passes
  • Dashboard starts; GET /api returns {"version":"...","apiDocs":"/api/openapi.json"}
  • GET /api/openapi.json returns a valid OAS3 document with all expected paths
  • GET /swagger-ui redirects to /swagger-ui.html; Swagger UI loads the git-proxy-java spec (not the petstore)
  • All operationIds are unique and match the annotations
  • defaultValue query params (e.g. section on /api/config/reload) are not marked required: true

closes #121

Adds /api/openapi.json and /api/openapi.yaml endpoints generated from
Spring MVC route metadata at startup, plus a Swagger UI browser at
/swagger-ui backed by a custom HTML page that bypasses swagger-initializer.js.

Uses swagger-core-jakarta (no JAX-RS dep) + RequestMappingHandlerMapping
to build the OAS3 spec without springdoc or Spring Boot. WebJar paths are
versioned and injected via Gradle token expansion at build time.

All controllers annotated with @tag and @operation for a clean spec
grouped by System, Auth, Users, Repos, Push, Providers, Profile, Admin.

closes #121
@coopernetes coopernetes enabled auto-merge (squash) April 15, 2026 18:23
@coopernetes coopernetes disabled auto-merge April 15, 2026 18:24
… docs link

Adds a public /api endpoint (no auth) that returns the app version and
the path to the OpenAPI spec. Useful as a quick sanity-check that the API
is reachable. SecurityConfig updated to permit /api alongside the other
public endpoints.
@coopernetes coopernetes enabled auto-merge (squash) April 15, 2026 18:27
…scanning

OWASP dependency-check is failing due to a breaking NVD API change
(nanosecond-precision timestamps not handled by the Jackson deserializer;
dependency-check/DependencyCheck#8425). No fix is available yet.

Replaces the depcheck job with:
- org.cyclonedx.bom 3.2.4 plugin generating a CycloneDX SBOM at build time
- anchore/scan-action scanning the SBOM with Grype (same scanner used for
  npm and container image scans)

Also adds failOnError=false to the dependencyCheck config so local runs
with the OWASP plugin don't abort when NVD is unavailable.

Renames CI job display names to be tool-agnostic:
- 'CVE / Dependency Check (Gradle)' -> 'CVE / Gradle'
- 'CVE / Grype (npm)' -> 'CVE / npm'
- 'Grype / Container Scan' -> 'Container Scan'

Branch protection and release gate rulesets updated to match new names.
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@coopernetes coopernetes merged commit f41bafb into main Apr 15, 2026
9 checks passed
@coopernetes coopernetes deleted the feat/openapi-spec branch April 15, 2026 19:25
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.

OpenAPI spec generation

2 participants