Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feature(std-http-server): option to inject request metadata into context #2070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
chaseisabelle wants to merge 1 commit into oapi-codegen:main
base: main
Choose a base branch
Loading
from chaseisabelle:feature/inject-request-metadata-into-context

Conversation

Copy link
Contributor

@chaseisabelle chaseisabelle commented Aug 30, 2025
edited
Loading

Added an option to inject request metadata into the context for the std-http-server. This will be useful for downstream logging, metrics, tracing, observability, and custom authorization implementations.

Checklist:

  • All make commands (tidy, test, generate, and lint) have been run ✅
  • Default is false/off to preserve existing behavior ✅
  • Added test cases and mock std-http-server ✅
  • Generated code has been committed for review ✅

Example:

// set the option to enable metadata context injection
han := oapi.HandlerWithOptions(srv, StdHTTPServerOptions{
 WithRequestMetadata: true,
})
// get the injected metadata from the context 
md := oapi.RequestMetadataFromContext(ctx)
opID := md.OperationID
path := md.RequestRoute

@chaseisabelle chaseisabelle requested a review from a team as a code owner August 30, 2025 16:58
Copy link

Kusari Inspector

Kusari Analysis Results:

Proceed with these changes

✅ No Flagged Issues Detected
All values appear to be within acceptable risk parameters.

No pinned version dependency changes, code issues or exposed secrets detected!

@kusari-inspector rerun - Trigger a re-analysis of this PR
@kusari-inspector feedback [your message] - Send feedback to our AI and team
See Kusari's documentation for setup and configuration.
Commit: 3582ae5, performed at: 2025年08月30日T16:58:19Z

Found this helpful? Give it a 👍 or 👎 reaction!

@chaseisabelle chaseisabelle marked this pull request as draft August 30, 2025 17:00
@chaseisabelle chaseisabelle marked this pull request as ready for review August 30, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /