SMILEY4 / ktor-swagger-ui

Kotlin Ktor plugin to generate OpenAPI and provide Swagger UI
Apache License 2.0
150 stars 25 forks source link

Structural error at components.securitySchemes #78

Closed douglasqueirozalmeida closed 7 months ago

douglasqueirozalmeida commented 8 months ago

I don't know if the documentation is out of date or if it really is a problem.

securityScheme(JWT_SECURITY) {
                type = AuthType.HTTP
                scheme = AuthScheme.BEARER
                bearerFormat = "jwt"
}

JSON

"jwtSecurity" : {
        "type" : "http",
        "scheme" : "Bearer",
        "bearerFormat" : "jwt"
      }

Swagger Validate

Structural error at components.securitySchemes.MyJwtAuth
should NOT have a `bearerFormat` property without `scheme: bearer` being set

The problem is because the word Bearer has the first letter capitalized. It needs to be all in lowercase letters. bearer

douglasqueirozalmeida commented 8 months ago

@SMILEY4 can you help?

SMILEY4 commented 8 months ago

Hi, i can change it to lowercase bearer. Though i am not quite sure why the validator reports this as an error. According to https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml Bearer should be a valid name.