Skip to content

Add response schema log support#47

Merged
gonzauy merged 1 commit into
masterfrom
add/log-response-schema-fn
Feb 11, 2026
Merged

Add response schema log support#47
gonzauy merged 1 commit into
masterfrom
add/log-response-schema-fn

Conversation

@gonzauy
Copy link
Copy Markdown
Collaborator

@gonzauy gonzauy commented Feb 10, 2026

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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.

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.

Comment thread src/create-app.ts
Comment thread src/async.ts Outdated
Comment thread src/types.ts Outdated
@gonzauy gonzauy force-pushed the add/log-response-schema-fn branch from ec3d509 to f03a3b3 Compare February 11, 2026 12:45
@gonzauy gonzauy merged commit fbb5e95 into master Feb 11, 2026
1 check passed
@gonzauy gonzauy deleted the add/log-response-schema-fn branch February 11, 2026 13:29
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.

3 participants