Model REST auth in OpenAPI as bearer security instead of an Authorization header parameter#3707
Draft
JerryNixon with Copilot wants to merge 3 commits into
Draft
Model REST auth in OpenAPI as bearer security instead of an Authorization header parameter#3707JerryNixon with Copilot wants to merge 3 commits into
JerryNixon with Copilot wants to merge 3 commits into
Conversation
1 task
Copilot
AI
changed the title
[WIP] Fix incorrect OpenAPI specification causing error in Swagger
Model REST auth in OpenAPI as bearer security instead of an Authorization header parameter
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
Authorizationheader parameters, so DAB's generated OpenAPI showed an auth field that was not sent onTry it out.components.securitySchemes, which prevents Swagger UI from using the standardAuthorizeflow for bearer tokens. The issue reproduces with Azure AD + authenticated REST entities and appears in the generated Swagger UI as shown in the attached screenshot.What is this change?
OpenAPI auth model
Authorizationas an operation header parameter.Unauthenticated.Operation parameters
X-MS-API-ROLEas a normal operation header parameter.Coverage
Authorizationis absent from operation headers.X-MS-API-ROLEremains available as a header parameter{ "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "security": [ { "BearerAuth": [] } ] }How was this tested?
Sample Request(s)
Authorizationas an operation header parameter.