Skip to content

Add express-validator list middleware#1163

Merged
karilint merged 1 commit into
mainfrom
codex/express-validator-crosssearch-733
May 21, 2026
Merged

Add express-validator list middleware#1163
karilint merged 1 commit into
mainfrom
codex/express-validator-crosssearch-733

Conversation

@karilint
Copy link
Copy Markdown
Collaborator

@karilint karilint commented May 21, 2026

Closes #733

Summary

  • add express-validator to the backend dependencies
  • introduce middleware-backed request-shape validation for cross-search rows, localities, and export routes
  • add a reusable tab-list query validator middleware and apply it to secondary list endpoints:
    • museum localities
    • reference localities/species
    • time-unit localities
    • time-bound time-units
  • keep the existing shared validators/parsers for semantic checks and query normalization

Validation

  • git diff --check
  • npm run lint:backend
  • npm run tsc:backend
  • cd backend && DOTENV_CONFIG_PATH=../.test.env NODE_OPTIONS='-r dotenv/config' npx jest src/api-tests/crossSearch/get.test.ts src/api-tests/crossSearch/export.test.ts --runInBand --config jest-config.js --detectOpenHandles --forceExit
  • cd backend && DOTENV_CONFIG_PATH=../.test.env NODE_OPTIONS='-r dotenv/config' npx jest src/api-tests/tabLists/queryValidation.test.ts --runInBand --config jest-config.js --detectOpenHandles --forceExit
  • commit hook before the follow-up: npm run lint and npm run tsc

Notes

This is still intentionally incremental: request-shape validation moves into middleware, while domain-specific validation and query normalization stay with the existing shared services.

@karilint karilint force-pushed the codex/express-validator-crosssearch-733 branch from c22eb99 to 143fcce Compare May 21, 2026 13:02
@karilint karilint changed the title Add express-validator cross-search middleware Add express-validator list middleware May 21, 2026
@karilint karilint marked this pull request as ready for review May 21, 2026 13:17
@karilint karilint merged commit 83f7b02 into main May 21, 2026
3 of 4 checks passed
@karilint karilint deleted the codex/express-validator-crosssearch-733 branch May 21, 2026 13:18
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.

Look into possibly adding express-validator as middleware

1 participant