Skip to content
Snippets Groups Projects
Commit d8fe4719 authored by Martti Käärik's avatar Martti Käärik
Browse files

Check for parse result and throw

parent 12ba17f8
No related branches found
No related tags found
No related merge requests found
Pipeline #9376 passed
......@@ -574,9 +574,13 @@ public class OpenAPI2TDLTranslatorNext extends AbstractTranslator {
*
* @param specFilePath The path to the specification file
* @return A "raw" OpenAPI document
* @throws Exception
*/
public static OpenAPI parseSpec(String specFilePath, Boolean processInline) {
public static OpenAPI parseSpec(String specFilePath, Boolean processInline) throws Exception {
OpenAPI openAPI = new OpenAPIParser().readLocation(specFilePath, null, new ParseOptions()).getOpenAPI();
if (openAPI == null)
throw new Exception("Failed to parse '" + specFilePath + "', make sure it's valid ");
// Invoke helper function to get the original swagger version.
// See https://github.com/swagger-api/swagger-parser/pull/1374
// Also see https://github.com/swagger-api/swagger-parser/issues/1369.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment