API Designer not generating SecuritySchema Header in Request

Hello,

I have defined an API spec using API Designer. I specified a securitySchema and applied it to the endpoint. When I generate a collection, the request does not have a header of ‘Authorization’ that I expected.

What I am desiring to happen, is when I generate a collection, I want a request to have a Header key of “Authorization” and a Header value of "{{ACCESS_TOKEN}}. I am seeing a header key of ‘Authorization’ generated in the request but with no value.

Is there something I need to do differently to make this happen? I figured the securitySchema way was the right way. The security schema defined below is what is generated when I import an OpenAPI 3.0 spec from AWS API Gateway with this header set.

paths:
  /sample:
    get:
      summary: Sample
      operationId: sample
      security:
        - authorizer: []
...
components:
...
securitySchemes:
  authorizer:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "custom"

The corresponding request generated has the following in the Header.

When validating API spec using API Designer to the generated collection without modification, I get the following suggested changes.The ‘Authorization’ header generated from spec is now indicating that the collection shouldn’t have the header ‘Authorization’ anymore. Seems this feature is not consistent.

Thank you

I am no expert into this, but it looks to me that your configuration is not valid.

It should be

name: x-amazon-apigateway-authtype

not

x-amazon-apigateway-authtype: "custom"

Thank you vdespa for your response. There already exists a ‘name’ attribute with value ‘Authorization’.

If I change the line you indicate, I get a yaml parsing error as there are two ‘name’ attributes.

securitySchemes:
  authorizer:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    name: x-amazon-apigateway-authtype

If I remove the ‘x-amazon-apigateway-authtype: “custom”’ line, I end up with the securitySchema defined below. I see just an Authorization header in the request generated, but validate schema doesn’t recognize the ‘Authorization’ header and suggests to remove it to be in sync.

securitySchemes:
  authorizer:
    type: "apiKey"
    name: "Authorization"
    in: "header"
    x-amazon-apigateway-authtype: "custom"

image

If I remove my original ‘name’ attribute with value ‘Authorization’ and replace it with the ‘name’ attribute that was suggested, I end up with the below as a header value which is not what I am needing.

securitySchemes:
  authorizer:
    type: "apiKey"
    name: x-amazon-apigateway-authtype
    in: "header"

This appears to have been resolved when I checked this morning. Bugs must be getting squashed by the dev team in relation to API Designer collection generation and schema validation.