Repository navigation
fix: stop spurious mount warnings and reject unusable validation config - #10
Merged
Michael McQuade (giraffesyo) merged 1 commit intoOct 1, 2026
Conversation
The not-async warning was raised for the validators that fsrouter adds itself, so every route with validation printed it. Only the handlers that a route file exports are checked now. Validation keys other than body and query, schemas that are not objects, and validation for a method without a handler now stop the router from starting. Files in a folder prefixed with _ are skipped. A UserFacingError status code outside of 400-599 is answered with a 500.
Michael McQuade (giraffesyo)
deleted the
fix/logging-and-validation-hardening
branch
October 1, 2026 23:47
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the mount-time log noise and tightens a few places where a route file could be misconfigured without anyone noticing.
Logging
console.warninstead ofconsole.error.logMountsisfalse. A test asserts this.Mounting route:with an empty path, it now prints/.defaultErrorHandlerlogged "shown in development" in production too. The message no longer mentions the environment.Validation
bodyorqueryundervalidation.<METHOD>(e.g.Body) was ignored, so the route was mounted "with validation" but nothing was validated. This is now an error at startup, as is a schema that is not an object.Routing
_are skipped, like files prefixed with_already were. Before, a helper such as_lib/helper.tsthat exports a function namedgetwas mounted as a route.Errors
UserFacingErrorwhose status code is not an integer from 400 to 599 is answered with a 500, instead of a success status or a failed response.Upgrade notes
_prefixed folder is no longer mounted.bodyorquery, or with validation for a method that it does not export, stops the router from starting.Testing
pnpm typecheck,pnpm test(41 tests, 16 new) andpnpm buildpass. 10 of the new tests fail against the previous source.parallelworks/corepackages/apiwith 0.2.2 and with this branch: the same 12 routes with the same handlers, and identical responses to 12 requests in production and development mode.