@Test void validateWithUnderscoreLegacyNamingOptionTestShouldReturnNoError() throws Exception { OptionManager optionManager = new OptionManager(); Options options = optionManager.getOptions(); CommandLine commandLine = parser.parse(options, new String[]{"-s", "src/test/resources/some.yaml", "-o", "src/test/resources/underscoreLegacy.json"}); List<StyleError> errorList = Main.validate(optionManager, commandLine); assertEquals(0, errorList.size()); }
static List<StyleError> validate(OptionManager optionManager, CommandLine commandLine) { OpenAPIParser openApiParser = new OpenAPIParser(); ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(true); SwaggerParseResult parserResult = openApiParser.readLocation(optionManager.getSource(commandLine), null, parseOptions); io.swagger.v3.oas.models.OpenAPI swaggerOpenAPI = parserResult.getOpenAPI(); org.eclipse.microprofile.openapi.models.OpenAPI openAPI = SwAdapter.toOpenAPI(swaggerOpenAPI); OpenApiSpecStyleValidator openApiSpecStyleValidator = new OpenApiSpecStyleValidator(openAPI); ValidatorParameters parameters = optionManager.getOptionalValidatorParametersOrDefault(commandLine); return openApiSpecStyleValidator.validate(parameters); }
Main { static List<StyleError> validate(OptionManager optionManager, CommandLine commandLine) { OpenAPIParser openApiParser = new OpenAPIParser(); ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(true); SwaggerParseResult parserResult = openApiParser.readLocation(optionManager.getSource(commandLine), null, parseOptions); io.swagger.v3.oas.models.OpenAPI swaggerOpenAPI = parserResult.getOpenAPI(); org.eclipse.microprofile.openapi.models.OpenAPI openAPI = SwAdapter.toOpenAPI(swaggerOpenAPI); OpenApiSpecStyleValidator openApiSpecStyleValidator = new OpenApiSpecStyleValidator(openAPI); ValidatorParameters parameters = optionManager.getOptionalValidatorParametersOrDefault(commandLine); return openApiSpecStyleValidator.validate(parameters); } }
Main { static List<StyleError> validate(OptionManager optionManager, CommandLine commandLine) { OpenAPIParser openApiParser = new OpenAPIParser(); ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(true); SwaggerParseResult parserResult = openApiParser.readLocation(optionManager.getSource(commandLine), null, parseOptions); io.swagger.v3.oas.models.OpenAPI swaggerOpenAPI = parserResult.getOpenAPI(); org.eclipse.microprofile.openapi.models.OpenAPI openAPI = SwAdapter.toOpenAPI(swaggerOpenAPI); OpenApiSpecStyleValidator openApiSpecStyleValidator = new OpenApiSpecStyleValidator(openAPI); ValidatorParameters parameters = optionManager.getOptionalValidatorParametersOrDefault(commandLine); return openApiSpecStyleValidator.validate(parameters); }  }
Main { static List<StyleError> validate(OptionManager optionManager, CommandLine commandLine) { OpenAPIParser openApiParser = new OpenAPIParser(); ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(true); SwaggerParseResult parserResult = openApiParser.readLocation(optionManager.getSource(commandLine), null, parseOptions); io.swagger.v3.oas.models.OpenAPI swaggerOpenAPI = parserResult.getOpenAPI(); org.eclipse.microprofile.openapi.models.OpenAPI openAPI = SwAdapter.toOpenAPI(swaggerOpenAPI); OpenApiSpecStyleValidator openApiSpecStyleValidator = new OpenApiSpecStyleValidator(openAPI); ValidatorParameters parameters = optionManager.getOptionalValidatorParametersOrDefault(commandLine); return openApiSpecStyleValidator.validate(parameters); }  static void main(String[] args); }
Main { static List<StyleError> validate(OptionManager optionManager, CommandLine commandLine) { OpenAPIParser openApiParser = new OpenAPIParser(); ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(true); SwaggerParseResult parserResult = openApiParser.readLocation(optionManager.getSource(commandLine), null, parseOptions); io.swagger.v3.oas.models.OpenAPI swaggerOpenAPI = parserResult.getOpenAPI(); org.eclipse.microprofile.openapi.models.OpenAPI openAPI = SwAdapter.toOpenAPI(swaggerOpenAPI); OpenApiSpecStyleValidator openApiSpecStyleValidator = new OpenApiSpecStyleValidator(openAPI); ValidatorParameters parameters = optionManager.getOptionalValidatorParametersOrDefault(commandLine); return openApiSpecStyleValidator.validate(parameters); }  static void main(String[] args);  }