Add response schema log support#47
Merged
Merged
Conversation
de8da7f to
ec3d509
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for logging response-schema validation failures (including the route pattern) via a new logResponseSchemaErrorsFn option, with accompanying docs and cucumber coverage.
Changes:
- Introduces
logResponseSchemaErrorsFnin public options/types and wires it through app creation into the async converter. - Extends response-schema handling to optionally log schema errors and/or reject invalid responses with HTTP 400.
- Adds an advanced-example route + cucumber steps/scenario to verify the callback is invoked with a route-pattern path; updates docs and version.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Adds the LogResponseSchemaErrorsFn type and exposes it on Opts. |
| src/create-app.ts | Passes new options into asyncConverter (and changes when compileSchema is forwarded). |
| src/async.ts | Implements response-schema error logging and route-pattern path reporting; adds new options plumbing. |
| src/examples/advanced/async-app.ts | Provides a test hook that captures callback invocations for assertions. |
| src/examples/advanced/app.ts | Adds a route that intentionally fails response schema validation for testing. |
| src/test.ts | Adds cucumber step definitions to reset/assert captured log calls. |
| features/advanced.feature | Adds scenario validating callback is called with route-pattern path. |
| features/analyze.feature | Updates expected analyzed route count due to added advanced route. |
| README.md | Documents response validation and the new logging callback. |
| package.json | Bumps package version to 4.11.0. |
| package-lock.json | Updates lockfile version field to match package.json bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ec3d509 to
f03a3b3
Compare
rsrebot
approved these changes
Feb 11, 2026
rsrebot
approved these changes
Feb 11, 2026
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.
Adds support for logging response-schema validation failures (including the route pattern) via a new logResponseSchemaErrorsFn option, with accompanying docs and cucumber coverage.
Changes:
Introduces logResponseSchemaErrorsFn in public options/types and wires it through app creation into the async converter.
Extends response-schema handling to optionally log schema errors and/or reject invalid responses with HTTP 400.
Adds an advanced-example route + cucumber steps/scenario to verify the callback is invoked with a route-pattern path; updates docs and version.