Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ApiListing in swagger-jersey2-jaxrs #501

Merged
merged 1 commit into from Mar 21, 2014
Merged
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 @@ -26,7 +26,7 @@ import scala.collection.mutable.LinkedHashMap
import scala.collection.JavaConverters._
import scala.collection.mutable.ListBuffer

object ApiListingCache {
object ApiListingCache extends ReaderUtil {
private val LOGGER = LoggerFactory.getLogger(ApiListingCache.getClass)

var _cache: Option[Map[String, ApiListing]] = None
Expand All @@ -42,7 +42,8 @@ object ApiListingCache {
}
// For each top level resource, parse it and look for swagger annotations.
val listings = (for(cls <- classes) yield reader.read(docRoot, cls, ConfigFactory.config)).flatten.toList
_cache = Some((listings.map(m => {
val mergedListings = groupByResourcePath(listings)
_cache = Some((mergedListings.map(m => {
// always start with "/"
val resourcePath = m.resourcePath.startsWith ("/") match {
case true => m.resourcePath
Expand Down