cancel
Showing results for 
Search instead for 
Did you mean: 

securityScheme error

Highlighted
New Contributor

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 2
Highlighted
Staff

Re: securityScheme error

Hello @pherold0923 ,

 

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

Highlighted
New Contributor

Re: securityScheme error

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.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors
Top Kudoed Posts