Skip to content

(wip) docs(optimizer): @ApiResponses on controllers for OpenAPI spec#598

Merged
mkuchenbecker merged 1 commit into
mkuchenb/optimizer-2from
mkuchenb/optimizer-2.3
May 22, 2026
Merged

(wip) docs(optimizer): @ApiResponses on controllers for OpenAPI spec#598
mkuchenbecker merged 1 commit into
mkuchenb/optimizer-2from
mkuchenb/optimizer-2.3

Conversation

@mkuchenbecker
Copy link
Copy Markdown
Collaborator

Status

(WIP) — inspection branch on top of mkuchenb/optimizer-2 (PR #531). Addresses Abhishek's review comment: list error codes in the API response via @ApiResponses per endpoint.

Summary

Adds @ApiResponses annotations to every optimizer REST endpoint, following the same "Resource ACTION: STATUS" convention used by services/tables.

Endpoint Codes
POST /v1/optimizer/operations/{id}/update 201, 400, 404
GET /v1/optimizer/operations/{id} 200, 404
GET /v1/optimizer/operations 200, 400
POST /v1/optimizer/operations-history 201
GET /v1/optimizer/operations-history/{tableUuid} 200, 400
PUT /v1/optimizer/stats/{tableUuid} 200
GET /v1/optimizer/stats/{tableUuid} 200, 404
GET /v1/optimizer/stats 200, 400
GET /v1/optimizer/stats/{tableUuid}/history 200, 400

Each endpoint lists only the codes it actually returns — no auth codes (no auth layer on this PR), no 500 (default catch-all behavior not user-facing contract).

Changes

  • 3 controllers, 9 endpoints, 9 @ApiResponses blocks.
  • 2 new imports per controller (io.swagger.v3.oas.annotations.responses.ApiResponse + ApiResponses).
  • swagger-annotations:2.1.11 already on the classpath via openhouse.springboot-conventions — no dep change.

Testing Done

  • No tests added — these are documentation annotations only.

./gradlew :services:optimizer:test — all green (existing 24 tests, no behavior change).

🤖 Generated with Claude Code

Address review on PR #531 — each endpoint lists the HTTP response codes
it actually returns, in the same "Resource ACTION: STATUS" style used
by services/tables.

Codes per endpoint:
- POST /operations/{id}/update — 201, 400, 404
- GET  /operations/{id}        — 200, 404
- GET  /operations             — 200, 400
- POST /operations-history     — 201
- GET  /operations-history/{u} — 200, 400
- PUT  /stats/{u}              — 200
- GET  /stats/{u}              — 200, 404
- GET  /stats                  — 200, 400
- GET  /stats/{u}/history      — 200, 400

Annotations only — no runtime behavior change, no new tests required.
swagger-annotations 2.1.11 is already on the optimizer classpath via
openhouse.springboot-conventions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mkuchenbecker mkuchenbecker merged commit 6ef7964 into mkuchenb/optimizer-2 May 22, 2026
@mkuchenbecker mkuchenbecker deleted the mkuchenb/optimizer-2.3 branch May 22, 2026 21:31
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