Problem
DemoApi OpenAPI annotations in framework templates do not fully cover runtime API endpoints and contain mismatches in path params and request payload fields. As a result, generated spec.json is incomplete and partially inaccurate.
Scope
src/Module/Templates/DemoApi/src/Controllers/OpenApi/*
Current Gaps
- Missing annotation coverage:
PUT /api/account-settings/update
PUT /api/account-settings/update-password
POST /api/comments/create/{uuid}
DELETE /api/comments/delete/{uuid}
- Mismatched annotation fields/params:
- auth path params (
activate_token, reset_token, otp_token) vs runtime (token, token, code)
- verify payload docs (
otp_code) vs runtime payload (otp, code)
- forget payload docs (
username) vs runtime payload (email)
- post-management path params (
id) vs runtime (uuid)
- Missing docs for posts query params:
- Invalid/legacy multipart file schema usage in some annotations (
type=file instead of type=string, format=binary).
Acceptance Criteria
- OpenAPI template coverage includes all routed DemoApi endpoints above.
- Path params and request body fields match runtime controller+middleware behavior.
posts endpoint query params are documented.
- Generated OpenAPI is valid and
/api/docs loads without spec errors after php qt install:openapi Api.
- Existing documented endpoints remain present (no regressions).
Validation Steps
- Generate DemoApi module from updated templates (or update existing generated files).
- Run
php qt install:openapi Api.
- Open
/api/spec and verify all expected paths are present.
- Open
/api/docs and confirm no schema/render errors.
- Spot-check request schemas for
verify, forget, reset, amend, comment/account endpoints.
Notes
This is a template-source fix in quantum-php-core; project-level patching is not sufficient for long-term consistency.
Problem
DemoApiOpenAPI annotations in framework templates do not fully cover runtime API endpoints and contain mismatches in path params and request payload fields. As a result, generatedspec.jsonis incomplete and partially inaccurate.Scope
src/Module/Templates/DemoApi/src/Controllers/OpenApi/*Current Gaps
PUT /api/account-settings/updatePUT /api/account-settings/update-passwordPOST /api/comments/create/{uuid}DELETE /api/comments/delete/{uuid}activate_token,reset_token,otp_token) vs runtime (token,token,code)otp_code) vs runtime payload (otp,code)username) vs runtime payload (email)id) vs runtime (uuid)per_page,page,qtype=fileinstead oftype=string, format=binary).Acceptance Criteria
postsendpoint query params are documented./api/docsloads without spec errors afterphp qt install:openapi Api.Validation Steps
php qt install:openapi Api./api/specand verify all expected paths are present./api/docsand confirm no schema/render errors.verify,forget,reset,amend, comment/account endpoints.Notes
This is a template-source fix in
quantum-php-core; project-level patching is not sufficient for long-term consistency.