Forum Discussion

pherold0923's avatar
pherold0923
New Contributor
5 years ago

securityScheme error

I'm trying to configure bearer authentication in an OpenAPI object using YAML in a Spring Boot app. Here is my YAML:

components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
security:
- bearerAuth: []

 But on application start-up, I get the following:

Failed to bind properties under 'openapi.config.components.securityschemes.bearerauth' to io.swagger.v3.oas.models.security.SecurityScheme:

Reason: Configuration property name '$ref' is not valid

Action:

Update your application's configuration

 

Any idea what my error is? Adding a name property to the above does not solve it.

2 Replies

  • Hello pherold0923 ,

     

    can you please clarify if this is a question for a swagger tools or just related to spring boot?

    • pherold0923's avatar
      pherold0923
      New Contributor

      That's a fair question. I only mention Spring Boot because I'm trying to configure OpenAPI using yaml property files that are part of SB framework support. Much of this is working just fine. SecurityScheme however is not. I've been able to accomplish what I want through @SecurityScheme annotation in my controller classes. It's not as clean, but workable.