Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

service and builder made extensible #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ class SwaggerApiBuilder(
) extends ReaderUtil
with LazyLogging {

val scanner = new SprayApiScanner(apiTypes)
val reader = new SprayApiReader()
val scanner = buildScanner

val listings: Map[String, ApiListing] = {
val reader = buildReader

val listings: Map[String, ApiListing] = buildListings

protected def buildScanner: SprayApiScanner = new SprayApiScanner(apiTypes)

protected def buildReader: SprayApiReader = new SprayApiReader()

protected def buildListings: Map[String, ApiListing] = {
logger.info("loading api metadata")
val classes = scanner match {
case scanner: Scanner => scanner.classes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ trait SwaggerHttpService
def apiInfo: Option[ApiInfo] = None
def authorizations: List[AuthorizationType] = List()

private val api =
protected val api: SwaggerApiBuilder = buildApi

protected def buildApi: SwaggerApiBuilder =
new SwaggerApiBuilder(
new SwaggerConfig(
apiVersion,
Expand Down