@Test public void checkBad() { String yaml = loadRelative("syntax-bad.yaml"); List<String> errors = SyntaxChecker.check(yaml); assertThat(errors).containsExactly("attribute paths.'/pets'(post).summary2 is unexpected"); }
public static List<String> check(String oasSpecContent) { ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(false); parseOptions.setResolveFully(false); parseOptions.setResolveCombinators(false); parseOptions.setFlatten(false); OpenAPIV3Parser parser = new OpenAPIV3Parser(); SwaggerParseResult result = parser.readContents(oasSpecContent, null, parseOptions); return result.getMessages() == null ? emptyList() : result.getMessages(); }
SyntaxChecker { public static List<String> check(String oasSpecContent) { ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(false); parseOptions.setResolveFully(false); parseOptions.setResolveCombinators(false); parseOptions.setFlatten(false); OpenAPIV3Parser parser = new OpenAPIV3Parser(); SwaggerParseResult result = parser.readContents(oasSpecContent, null, parseOptions); return result.getMessages() == null ? emptyList() : result.getMessages(); } }
SyntaxChecker { public static List<String> check(String oasSpecContent) { ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(false); parseOptions.setResolveFully(false); parseOptions.setResolveCombinators(false); parseOptions.setFlatten(false); OpenAPIV3Parser parser = new OpenAPIV3Parser(); SwaggerParseResult result = parser.readContents(oasSpecContent, null, parseOptions); return result.getMessages() == null ? emptyList() : result.getMessages(); } private  SyntaxChecker(); }
SyntaxChecker { public static List<String> check(String oasSpecContent) { ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(false); parseOptions.setResolveFully(false); parseOptions.setResolveCombinators(false); parseOptions.setFlatten(false); OpenAPIV3Parser parser = new OpenAPIV3Parser(); SwaggerParseResult result = parser.readContents(oasSpecContent, null, parseOptions); return result.getMessages() == null ? emptyList() : result.getMessages(); } private  SyntaxChecker(); static List<String> check(String oasSpecContent); }
SyntaxChecker { public static List<String> check(String oasSpecContent) { ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(false); parseOptions.setResolveFully(false); parseOptions.setResolveCombinators(false); parseOptions.setFlatten(false); OpenAPIV3Parser parser = new OpenAPIV3Parser(); SwaggerParseResult result = parser.readContents(oasSpecContent, null, parseOptions); return result.getMessages() == null ? emptyList() : result.getMessages(); } private  SyntaxChecker(); static List<String> check(String oasSpecContent);  }