cleaned up toApiName to strip bad chars

This commit is contained in:
Tony Tam 2012-12-18 22:53:46 -08:00
parent 28221b5f5a
commit 95d77807c2

View File

@ -38,7 +38,10 @@ trait PathUtil {
} }
def toApiName(name: String) = { def toApiName(name: String) = {
name.charAt(0).toUpperCase + name.substring(1) + "Api" name.replaceAll("\\{","").replaceAll("\\}", "") match {
case s: String if(s.length > 0) => s.charAt(0).toUpperCase + s.substring(1) + "Api"
case _ => "Api"
}
} }
def nameFromPath(apiPath: String) = { def nameFromPath(apiPath: String) = {