Skip to content

spectral:oas ruleset doesn't recognize mutualTLS option for security scheme #2476

Closed as not planned
@pdconant

Description

@pdconant

Describe the bug
When validating an OpenAPI spec that uses Mutual TLS, spectral lint, spectral reports that mutualTLS is not a viable security scheme. Mutual TLS support was added to Open API 3.1.

To Reproduce

  1. Create a .spectral.json file containing:
{
  "extends": ["spectral:oas", "spectral:asyncapi"]
}
  1. And an API spec that contains:

    "securitySchemes" : {
      "MutualTLS" : {
        "type" : "mutualTLS"
      }
    }
  1. Run the command: spectral lint {path-to}/api.json --ruleset {path-to}/.spectral.json,
  2. Observe the following output:
 2451:15    error  oas3-schema            Invalid security scheme.                                                                                  components.securitySchemes.MutualTLS
 2452:13    error  oas3-schema            "type" property must be equal to one of the allowed values: "apiKey", "http", "oauth2", "openIdConnect".  components.securitySchemes.MutualTLS.type

Expected behavior
Expected mutualTLS to be supported since it was added to OAS 3.1 here: OAI/OpenAPI-Specification#1764

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