use of io.swagger.v3.parser.core.extensions.SwaggerParserExtension in project swagger-parser by swagger-api.
the class OpenAPIV3Parser method read.
public OpenAPI read(String location, List<AuthorizationValue> auths, ParseOptions resolve) {
if (location == null) {
return null;
}
final List<SwaggerParserExtension> parserExtensions = getExtensions();
SwaggerParseResult parsed;
for (SwaggerParserExtension extension : parserExtensions) {
parsed = extension.readLocation(location, auths, resolve);
for (String message : parsed.getMessages()) {
LOGGER.info("{}: {}", extension, message);
}
final OpenAPI result = parsed.getOpenAPI();
if (result != null) {
return result;
}
}
return null;
}
use of io.swagger.v3.parser.core.extensions.SwaggerParserExtension in project swagger-parser by swagger-api.
the class OpenAPIV3Parser method getExtensions.
protected static List<SwaggerParserExtension> getExtensions(ClassLoader cl) {
final List<SwaggerParserExtension> extensions = new ArrayList<>();
final ServiceLoader<SwaggerParserExtension> loader = ServiceLoader.load(SwaggerParserExtension.class, cl);
for (SwaggerParserExtension extension : loader) {
extensions.add(extension);
}
return extensions;
}
Aggregations