forked from loafle/openapi-generator-original
Display an error when an API fails to parse.
This commit is contained in:
parent
7929dbfee1
commit
0b4fa11486
@ -43,11 +43,15 @@ object ApiExtractor extends RemoteUrl {
|
|||||||
Some(parse(json).extract[ApiListing])
|
Some(parse(json).extract[ApiListing])
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
case e:java.io.FileNotFoundException => {
|
case e: java.io.FileNotFoundException => {
|
||||||
println("WARNING! Unable to read API " + basePath + api.path)
|
println("WARNING! Unable to read API " + basePath + api.path)
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
case _ : Throwable=> None
|
case e: Throwable => {
|
||||||
|
println("WARNING! Unable to read API " + basePath + api.path)
|
||||||
|
e.printStackTrace()
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).flatten.toList
|
}).flatten.toList
|
||||||
}
|
}
|
||||||
@ -68,4 +72,4 @@ object ApiExtractor extends RemoteUrl {
|
|||||||
def extractApiOperations(basePath: String, apiDescription: ApiDescription): List[(String, Operation)] = {
|
def extractApiOperations(basePath: String, apiDescription: ApiDescription): List[(String, Operation)] = {
|
||||||
(for(op <- apiDescription.operations) yield (apiDescription.path, op)).toList
|
(for(op <- apiDescription.operations) yield (apiDescription.path, op)).toList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user