aws / aws-sdk-ruby

The official AWS SDK for Ruby.
https://aws.amazon.com/sdk-for-ruby/
Apache License 2.0
3.57k stars 1.22k forks source link

Generated API Gateway SDK does not provide a way to pass http headers #2124

Open mdkv4 opened 5 years ago

mdkv4 commented 5 years ago

Consider an API Gateway endpoint with a required HTTP request header for Accept-Language (e.g OpenAPI def):

  "paths": {
    "/jobs/{id}": {
      "get": {
        "operationId": "getById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Accept-Language",
            "in": "header",
            "required": true,
            "type": "string"
          }

The generated Ruby SDK does not provide a way to pass the required parameter to the endpoint.

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

API Gateway generated aws-sdk-v3

Thanks,

cjyclaire commented 5 years ago

Thanks for the feedback! Tracking this as a feature request for our client interface : D

github-actions[bot] commented 4 years ago

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

matjamesymj commented 3 years ago

I have been trying to get headers to show up in the generated gem but they only seem to work if you prefix with an X. So 'X-MY-header-example' works but, 'MY-header-example' does not work. We need the latter to work. Does anyone know how to achieve this?

Example serverless file:

events:
  - http:
      path: /v1/my-test-endpoint
      method: POST
      documentation:
        summary: 'test summary'
        description: 'test desc'
        requestModels:
          application/json: TestRequest
        requestHeaders:
          - name: MY-header-example
            description: 'example header that does not work'
            required: true
          - name: X-MY-header-example
            description: 'example header that works'
            required: true
          - name: X-Correlation-ID
            description: '  Unique ID that can be used to tie together log and other messages across multiple systems.'
            required: true
        methodResponses:
          - statusCode: '200'
            responseBody:
              description: 'Response for example endpoint'
            responseModels:
              application/json: EmptyResponse
          - statusCode: '400'
            responseModels:
              application/json: ExampleErrors
          - statusCode: '500'
            responseModels:
              application/json: ExampleErrors
      reqValidatorName: RequestValidator
      authorizer: aws_iam
github-actions[bot] commented 2 years ago

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.

github-actions[bot] commented 1 year ago

Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.