aws-sdk-ruby icon indicating copy to clipboard operation
aws-sdk-ruby copied to clipboard

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

Open mdkv4 opened this issue 5 years ago • 5 comments

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,

mdkv4 avatar Sep 23 '19 20:09 mdkv4

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

cjyclaire avatar Sep 23 '19 20:09 cjyclaire

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] avatar Sep 23 '20 00:09 github-actions[bot]

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

matjamesymj avatar Nov 07 '20 07:11 matjamesymj

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] avatar Nov 08 '21 00:11 github-actions[bot]

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] avatar Nov 09 '22 00:11 github-actions[bot]