Skip to content

feat: input validation hardening + /version and /help endpoints#27

Open
kumaakh wants to merge 18 commits into
mainfrom
e2e-s1.2-25981185129/api-enhancements
Open

feat: input validation hardening + /version and /help endpoints#27
kumaakh wants to merge 18 commits into
mainfrom
e2e-s1.2-25981185129/api-enhancements

Conversation

@kumaakh
Copy link
Copy Markdown
Collaborator

@kumaakh kumaakh commented May 17, 2026

Summary

  • Input validation hardening (Issue Add input validation for empty or blank strings #2): validateCreateInput and validateUpdateInput now reject empty/whitespace-only content and empty/whitespace-only tag values with clear error messages ({"errors": [{"field": "...", "message": "..."}]}).
  • GET /version endpoint (Issue Add --version flag to CLI #1): Returns {"name": "fleet-e2e-toy", "version": "1.0.0"} — version sourced dynamically from package.json via resolveJsonModule.
  • GET /help endpoint (Issue Implement a help command #3): Returns a static JSON document with a routes array describing all 8 API endpoints (method, path, description).
  • Docs: docs/api-enhancements.md captures architecture decisions, API contracts, and trade-offs for long-term reference.

Test plan

  • npm test — 40/40 tests pass (was 33; +7 new integration tests)
  • GET /version returns 200 with {"name": "fleet-e2e-toy", "version": "1.0.0"}
  • GET /help returns 200 with routes array of 8 entries each having method, path, description
  • POST /api/notes with empty/whitespace content returns 400
  • POST /api/notes with empty/whitespace tag values returns 400
  • PUT /api/notes/:id with empty/whitespace content returns 400
  • All existing tests continue to pass (no regressions)

Branch

e2e-s1.2-25981185129/api-enhancementsmain

fleet-reviewer added 18 commits May 17, 2026 00:33
Covers input validation hardening, GET /version endpoint,
and GET /help endpoint across two phases with verify checkpoints.
Plan passes all 13 review criteria. Validation hardening is correctly
prioritized as riskiest-first, phases are cohesive, and the plan aligns
with requirements.md intent.
All tasks complete (T1.1, T1.2, T2.1, T2.2, T2.3). 40/40 tests pass.
Issues 1, 2, 3 fully addressed. No regressions or security concerns.
…curacy)

docs/api-enhancements.md incorrectly documents validation error response as
array of strings; actual shape is array of {field, message} objects. Also
flags misleading requestBody? on GET /api/notes in the help example.
Both prior findings addressed: error body shape corrected to {field, message}
objects, and spurious requestBody removed from GET /api/notes example.
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