fix(Annotations): accept mutualTLS as a SecurityScheme type - #2193
Merged
Conversation
SecurityScheme validated type against http, apiKey, oauth2 and openIdConnect only, so the mutualTLS type added in 3.1 could not be written at all. The type joins the enum, validate() warns at 3.0.x with the same message the spec compiler uses - one shared log expectation covers all three modes - and Components::jsonSerialize() drops mutualTLS schemes from 3.0 documents, since a scheme cannot remove itself from the parent map. The Auth fixture covers the scheme type in both syntaxes: 3.0 omits it, 3.1 and 3.2 carry it.
DerManoMann
added a commit
to DerManoMann/swagger-php
that referenced
this pull request
Sep 12, 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.
Overview
SecuritySchemevalidatestypeagainst http, apiKey, oauth2 and openIdConnect only, so themutualTLStype added in OpenAPI 3.1 cannot be written in classic at all — the spec pipeline has carried it (with a 3.0 warn-and-omit) since theAuthscratch fixture was written, and the fixture could never cover it because the classic anchor could not express it. Third fix under the classic spec-compliance carve-out (#2190).Changes
mutualTLSjoins thetypeenum inSecurityScheme::$_typesSecurityScheme::validate()warns at 3.0.x, using the spec compiler's message text so one log expectation covers all three modesComponents::jsonSerialize()drops mutualTLS schemes from 3.0 documents — a scheme cannot remove itself from the parent mapAuthfixture covers the scheme type in both syntaxes: the 3.0 expectation omits it, 3.1 and 3.2 carry it