We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Swagger supports header parameters as described here https://swagger.io/docs/specification/describing-parameters/#header-parameters
The example I would like to see is add a @header() parameter like this example for a GitHub webhook:
@header()
export default class GitHubWebHookRouter { @request('post', '/webhook/github') @summary('Receive webhooks from GitHub.') @body(WebhookEvent) @header({'x-github-delivery': { type: string, required: true, default: '', description: 'GitHub ID' }}) @header({'x-github-event': { type: string, required: true, default: '', description: 'GitHub Event' }}) @header({'x-hub-signature-256': { type: string, required: true, default: '', description: 'GitHub 256 Signature' }}) @header({'x-github-hook-installation-target-id': { type: string, required: true, default: '', description: 'GitHub Target ID' }}) static async receiveGitHubWebHookController(ctx) { const payload = ctx.request.body; const id = ctx.request.headers['x-github-delivery']; const type = ctx.request.headers['x-github-event']; const targetId = parseInt(ctx.request.headers['x-github-hook-installation-target-id']); const verified = verify( GITHUB_WEBHOOK_SECRET, JSON.stringify(payload), ctx.request.headers['x-hub-signature-256'] ); ... } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Swagger supports header parameters as described here https://swagger.io/docs/specification/describing-parameters/#header-parameters
The example I would like to see is add a
@header()
parameter like this example for a GitHub webhook:The text was updated successfully, but these errors were encountered: