Skip to content

[2.x] feat: Add simple request and response handling helpers - #14

Merged
acoulton merged 3 commits into
2.xfrom
2.x-feat-helper-handlers
Nov 6, 2026
Merged

acoulton merged 3 commits into
2.xfrom
2.x-feat-helper-handlers

Conversation

@acoulton

@acoulton acoulton commented Nov 5, 2026

Copy link
Copy Markdown
Member

Adds simple utilities for:

  • Building JSON and plain-text responses.
  • Serving a 200 "OK" on GET e.g. for healtchecks.
  • Serving a 404.
  • Guarding that a request is using an allowed request method.

All are opt-in for use by consuming projects if they're suitable for the project requirements.

Simple request handlers that can be used by projects that don't require
anything more complex, and a factory function to provide a shorthand for
making a text response.
Which is the other common response type that we need.
@acoulton
acoulton requested a review from craig410 November 5, 2026 18:32
@acoulton

acoulton commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

@copilot handle the deprecation in the failing tests with guzzle/psr7^2 (do not change testcase values)

Co-authored-by: acoulton <416566+acoulton@users.noreply.github.com>

Copilot AI commented Nov 6, 2026

Copy link
Copy Markdown

@copilot handle the deprecation in the failing tests with guzzle/psr7^2 (do not change testcase values)

Updated in commit 6a948e1. The original testcase values are unchanged; the tests now use a ServerRequestInterface mock to avoid Guzzle PSR-7 2.x’s deprecated non-uppercase method constructor.

@craig410 craig410 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@acoulton
acoulton merged commit a5ad348 into 2.x Nov 6, 2026
3 checks passed
@acoulton
acoulton deleted the 2.x-feat-helper-handlers branch November 6, 2026 10:39
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