@Test public void testIssue1086() { OpenAPIParser openApiParser = new OpenAPIParser(); ParseOptions options = new ParseOptions(); OpenAPI openAPI = openApiParser.readLocation("issue1086.yaml", null, options).getOpenAPI(); Map<String, Schema> schemas = openAPI.getComponents().getSchemas(); ObjectSchema schema = (ObjectSchema) schemas.get("AssessCandidate").getProperties().get("test_results"); Schema score = schema.getProperties().get("score"); assertEquals(score.getMultipleOf().intValue(), 1); }
public SwaggerParseResult readLocation(String url, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readLocation(url, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; }
OpenAPIParser { public SwaggerParseResult readLocation(String url, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readLocation(url, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; } }
OpenAPIParser { public SwaggerParseResult readLocation(String url, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readLocation(url, auth, options); if(output != null && output.getOpenAPI() != null) { return output; } } return output; }  }
OpenAPIParser { public SwaggerParseResult readLocation(String url, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readLocation(url, 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 readLocation(String url, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult output = null; for(SwaggerParserExtension extension : OpenAPIV3Parser.getExtensions()) { output = extension.readLocation(url, 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);  }