protected OpenAPIConfiguration loadConfiguration() throws OpenApiConfigurationException { Map<String, OpenApiConfigurationLoader> loaders = getLocationLoaders(); try { if (StringUtils.isNotEmpty(configLocation)) { if (loaders.get("classpath").exists(configLocation)) { return loaders.get("classpath").load(configLocation); } if (loaders.get("file").exists(configLocation)) { return loaders.get("file").load(configLocation); } } // check known locations List<ImmutablePair<String, String>> knownLocations = getKnownLocations(); for (ImmutablePair<String, String> location : knownLocations) { if (loaders.get(location.left).exists(location.right)) { try { return loaders.get(location.left).load(location.right); } catch (IOException ioe) { // try next one } } } return null; } catch (Exception e) { throw new OpenApiConfigurationException(e.getMessage(), e); } }
throw new OpenApiConfigurationException("error initializing context: " + e.getMessage(), e); throw new OpenApiConfigurationException("error configuring objectMapper: " + e.getMessage(), e); throw new OpenApiConfigurationException("error configuring model converters: " + e.getMessage(), e);
protected OpenAPIConfiguration loadConfiguration() throws OpenApiConfigurationException { Map<String, OpenApiConfigurationLoader> loaders = getLocationLoaders(); try { if (StringUtils.isNotEmpty(configLocation)) { if (loaders.get("classpath").exists(configLocation)) { return loaders.get("classpath").load(configLocation); } if (loaders.get("file").exists(configLocation)) { return loaders.get("file").load(configLocation); } } // check known locations List<ImmutablePair<String, String>> knownLocations = getKnownLocations(); for (ImmutablePair<String, String> location : knownLocations) { if (loaders.get(location.left).exists(location.right)) { try { return loaders.get(location.left).load(location.right); } catch (IOException ioe) { // try next one } } } return null; } catch (Exception e) { throw new OpenApiConfigurationException(e.getMessage(), e); } }
throw new OpenApiConfigurationException("error initializing context: " + e.getMessage(), e); throw new OpenApiConfigurationException("error configuring objectMapper: " + e.getMessage(), e); throw new OpenApiConfigurationException("error configuring model converters: " + e.getMessage(), e);