Repository navigation
docs(endpoints): generate HTTP endpoint docs with Spring REST Docs and publish to GitHub Pages - #6
Merged
Merged
Conversation
…Hub Pages - GameControllerApiDocsTest documents GET /, POST /new-game and POST /mark-tile (form parameters, Location header, curl and HTTP examples) - src/docs/asciidoc/index.adoc assembles the snippets plus login/logout notes - `./gradlew asciidoctor` renders build/docs/asciidoc/index.html - api-docs workflow builds the docs on PRs and deploys them to Pages from master - README gets an API Endpoints section linking to the hosted docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 0 |
🟢 Coverage ∅ diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation (-1.00%) Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (c71b85a) 171 171 100.00% Head commit (a1e3d22) 171 (+0) 171 (+0) 100.00% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#6) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…rated docs
The endpoints are browser routes, not a JSON API, so "API" was misleading.
- README section shortened to a description plus a link to the generated docs
- docs page title, workflow ("Endpoint Docs") and test class
(GameControllerDocsTest) renamed to match
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the app's HTTP endpoints with Spring REST Docs. The request and response examples come from tests, so they can't drift from the code: if a parameter is renamed or added without updating the docs, the test fails. The endpoints are browser routes (page loads and form posts), not a JSON API, so everything is named "HTTP endpoints" rather than "API".
GameControllerDocsTest(@WebMvcTest+@AutoConfigureRestDocs) documentsGET /,POST /new-gameandPOST /mark-tile: form parameters, theLocationredirect header, andcurl/HTTP examples. Requests use the real/tictactoecontext path, aJSESSIONIDcookie and a_csrfparameter, so the examples match what a logged-in browser sends.src/docs/asciidoc/index.adocassembles the snippets, plus an overview (auth, CSRF, Post/Redirect/Get) and notes on the Spring Security/loginand/logoutendpoints.build.gradleadds theorg.asciidoctor.jvm.convertplugin../gradlew asciidoctorruns the tests and rendersbuild/docs/asciidoc/index.html. AsciidoctorJ is pinned to 3.0.1 becausespring-restdocs-asciidoctor4.x fails with anAbstractMethodErroron the plugin's default 2.x..github/workflows/endpoint-docs.yml("Endpoint Docs") builds the docs on every PR and deploys them to GitHub Pages on pushes tomaster.Before merging
GitHub Pages isn't enabled for this repo yet. In Settings → Pages, set Source to GitHub Actions. Otherwise the deploy job fails and the README link returns 404.
Test plan
./gradlew build: 32 tests pass, including the 3 new docs tests./gradlew asciidoctorrendersindex.htmlwith no unresolved includesdocker buildstill succeeds (bootJardoesn't involve the docs)🤖 Generated with Claude Code