Skip to content

Resolve issue with 'Bearer SECRET, Bearer YOUR_SECRET_TOKEN' #884

@akins-dev

Description

@akins-dev
const HeadersSchema = z.object({
  // Header keys must be in lowercase, `Authorization` is not allowed.
  authorization: z.string().openapi({
    example: 'Bearer SECRET',
  }),
})

The above gives me this :

{Authorization: 'Bearer SECRET, Bearer YOUR_SECRET_TOKEN'}

I guess it is being handled by default. So, I had to replace it with
authorization: z.string().optional()

Now it works fine and shows {Authorization: 'Bearer YOUR_SECRET_TOKEN'}

I suggest fixing this in the docs to help others avoid this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions