Skip to content

Feat/openapi frontend contract - #39

Merged
AsierCL merged 3 commits into
mainfrom
feat/openapi-frontend-contract
Nov 7, 2026
Merged

AsierCL merged 3 commits into
mainfrom
feat/openapi-frontend-contract

Conversation

@AsierCL

@AsierCL AsierCL commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

…alid tokens

Unauthenticated requests used to fail with 403 and an empty body, so a client
could not tell 'not logged in' from 'not allowed'. Now:
- 401 + {errorMessage, errorCode:UNAUTHENTICATED_ACCESS} for missing/invalid token
- 403 + {errorMessage, errorCode:ACCESS_DENIED} for authenticated without role

Tests updated where they asserted 403 for 'not authenticated' cases;
AuthErrorContractTest pins the new contract and that guest endpoints stay open.
- public operations marked security: [] (catalog, guest-visible files, /api/auth/**)
- 401 documented on protected operations
- every 4xx/5xx response references ErrorDTO
- duplicate tag removed, /health is GET only
- openapi.json regenerated and guarded by OpenApiContractTest (fails on drift)
Versioning Documentation/openapi.json meant a ~50 KB diff on every API change
and silent drift. The spec is now generated from the running application in the
openapi CI job and published as the 'openapi' artifact; the file is no longer
tracked.

Local: ./mvnw test -Dtest=OpenApiContractTest -Dopenapi.export=true
@AsierCL
AsierCL merged commit 736e585 into main Nov 7, 2026
3 checks passed
@AsierCL
AsierCL deleted the feat/openapi-frontend-contract branch November 7, 2026 16:47
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