class Oas30ModelHelper {

    static String getHost(Oas30Document openApiDoc) {
        if (openApiDoc.servers == null || openApiDoc.servers.isEmpty()) {
            return null;
        }

        String serverUrl = resolveUrl(openApiDoc.servers.get(0));
        if (serverUrl.startsWith(HTTP)) {
            try {
                return new URL(serverUrl).getHost();
            } catch (MalformedURLException e) {
                LOG.warn(String.format("Unable to determine base path from server URL: %s", serverUrl));
            }
        }

        return null;
    }

    private  Oas30ModelHelper();

}