Closed qlibin closed 6 years ago
Thanks for reporting!
Might be related to #773 .
Not sure @ddufourboivin-zalando. #773 seems to be about the parse failing but that's not what's happening here. The file is syntactically valid swagger and parses correctly as such, where it fails is in the conversion to openapi - the upstream conversion code makes assumptions that simply aren't reliably true.
In this case, we possibly ought to offer a patch upstream, but can work around it with something like this in DefaultContext.kt:
// hack to allow OAuth2 definition with no scopes
swagger.securityDefinitions?.values?.filterIsInstance(OAuth2Definition::class.java)?.forEach {
if (it.scopes == null) {
it.scopes = LinkedHashMap()
}
}
I've noticed that the Zally-CLI fails on missing
scopes
field insecurityDefinitions
api-without-scopes.yaml:
The following file doesn't produce status 500 response: