Skip to content

Commit

Permalink
add SecuritySchemes in Sample App
Browse files Browse the repository at this point in the history
  • Loading branch information
ndy2 committed Dec 19, 2024
1 parent 8ef7933 commit e113ae9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.jakehschwartz.finatra.swagger

import com.google.inject.Provides
import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.{Components, OpenAPI}
import io.swagger.v3.oas.models.info.Info
import io.swagger.v3.oas.models.security.SecurityRequirement
import io.swagger.v3.oas.models.security.{SecurityRequirement, SecurityScheme}

import javax.inject.Singleton

Expand All @@ -23,6 +23,11 @@ object SampleSwaggerModule extends SwaggerModule {
openAPI
.info(info)
.addSecurityItem(new SecurityRequirement().addList("sampleBasic", "basic"))
.components(
new Components().addSecuritySchemes(
"sampleBasic", new SecurityScheme().`type`(SecurityScheme.Type.HTTP).scheme("basic")
)
)

openAPI
}
Expand Down

0 comments on commit e113ae9

Please sign in to comment.