Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #6768
Closed
Open
Issue created Jun 24, 2020 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] Authorization Header; Case is not respected

Created by: RalphBragg

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used? Latest Master
  • Have you search for related issues/PRs? Yes
  • What's the actual output vs expected output? Header is accepted with a capitilsation
  • [Optional] Bounty to sponsor the fix (example)
Description

An OAuth 2.0 Access Token is conveyed in a header called Authorization. This can be defined for example like below. - description: 'An Authorisation Token as per https://tools.ietf.org/html/rfc6750' explode: false in: header name: Authorization required: true schema: type: string style: simple

Unfortunately the capitalization requirements of the Authorization header isn't being respected by the generator

{ "error": [ { "path": ".headers.authorization", "message": "should have required property 'authorization'", "errorCode": "required.openapi.validation" } ] }

So a request with Authorization results in an error being thrown.

openapi-generator version

Latest, it is not a regression.

OpenAPI declaration file content or url
        - description: 'An Authorisation Token as per https://tools.ietf.org/html/rfc6750'
          explode: false
          in: header
          name: Authorization
          required: true
          schema:
            type: string
          style: simple
Command line used for generation

openapi-generator generate -g nodejs-express-server -i account-info-openapi.yaml

Steps to reproduce

Generate the server, launch server, send a request with an Authorization header with a capital A.

Assignee
Assign to
Time tracking