securityScheme error
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @pherold0923 ,
can you please clarify if this is a question for a swagger tools or just related to spring boot?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
