Skip to content

[OpenApi] Additional property "scheme" in SecuritySchema #4071

Description

@BeyerJC

API Platform version(s) affected: 2.6.2

Description

  securitySchemes:
    oauth:
      scheme: oauth2 <--- this one

The error is : components.securitySchemes.oauth should NOT have additional properties. This field is also not mentioned on https://swagger.io/docs/specification/authentication/oauth2/

How to reproduce
Enable the implicit flow in the apiplatform configuration.

Possible Solution
The value is nullable but its pre set here

return new Model\SecurityScheme($this->openApiOptions->getOAuthType(), $description, null, null, 'oauth2', null, new Model\OAuthFlows($implicit, $password, $clientCredentials, $authorizationCode), null);

Set the default value to null.

Edit: I just saw that its used for BasicAuth.

components:
  securitySchemes:
    basicAuth: 
      type: http
      scheme: basic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions