@Test public void test30() { String json = "{\n" + " \"openapi\": \"3.0.1\",\n" + " \"info\": {\n" + " \"title\": \"Swagger Petstore\",\n" + " \"description\": \"This is a sample server Petstore server. You can find out more about Swagger at [http: " \"termsOfService\": \"http: " \"contact\": {\n" + " \"email\": \"apiteam@swagger.io\"\n" + " },\n" + " \"license\": {\n" + " \"name\": \"Apache 2.0\",\n" + " \"url\": \"http: " },\n" + " \"version\": \"1.0.0\"\n" + " }\n" + "}"; ParseOptions options = new ParseOptions(); options.setResolve(true); SwaggerParseResult result = new OpenAPIParser().readContents(json, null, options); assertNotNull(result); assertNotNull(result.getOpenAPI()); assertEquals(result.getOpenAPI().getOpenapi(), "3.0.1"); }
public SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readContents(swaggerAsString, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; }
OpenAPIParser { public SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readContents(swaggerAsString, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; } }
OpenAPIParser { public SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readContents(swaggerAsString, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; }  }
OpenAPIParser { public SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readContents(swaggerAsString, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; }  SwaggerParseResult readLocation(String url, List<AuthorizationValue> auth, ParseOptions options); SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options); }
OpenAPIParser { public SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readContents(swaggerAsString, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; }  SwaggerParseResult readLocation(String url, List<AuthorizationValue> auth, ParseOptions options); SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options);  }