public class URLPathUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LOCAL_HOST |
static Pattern |
VARIABLE_PATTERN |
| Constructor and Description |
|---|
URLPathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getHost(io.swagger.v3.oas.models.OpenAPI openAPI,
Map<String,String> userDefinedVariables)
Return the first complete URL from the OpenAPI specification
|
static String |
getPath(URL url,
String defaultPath)
Return the path, example value
/abcdef/xyz |
static String |
getPort(URL url,
int defaultPort)
Return the port, example value
8080 |
static String |
getPort(URL url,
String defaultPort)
Return the port, example value
8080 |
static String |
getProtocolAndHost(URL url)
Get the protocol and the host, example value
https://www.abcdef.xyz |
static String |
getScheme(io.swagger.v3.oas.models.OpenAPI openAPI,
CodegenConfig config) |
static String |
getScheme(URL url,
CodegenConfig config) |
static URL |
getServerURL(io.swagger.v3.oas.models.OpenAPI openAPI,
Map<String,String> userDefinedVariables) |
static URL |
getServerURL(io.swagger.v3.oas.models.servers.Server server,
Map<String,String> userDefinedVariables) |
public static final String LOCAL_HOST
public static final Pattern VARIABLE_PATTERN
public static URL getServerURL(io.swagger.v3.oas.models.OpenAPI openAPI, Map<String,String> userDefinedVariables)
public static URL getServerURL(io.swagger.v3.oas.models.servers.Server server, Map<String,String> userDefinedVariables)
public static String getScheme(io.swagger.v3.oas.models.OpenAPI openAPI, CodegenConfig config)
public static String getScheme(URL url, CodegenConfig config)
public static String getPort(URL url, int defaultPort)
8080url - server urldefaultPort - if the port is not setpublic static String getPort(URL url, String defaultPort)
8080url - server urldefaultPort - if the port is not setpublic static String getPath(URL url, String defaultPath)
/abcdef/xyzurl - server urldefaultPath - if the path is not emptypublic static String getProtocolAndHost(URL url)
https://www.abcdef.xyzurl - server urlpublic static String getHost(io.swagger.v3.oas.models.OpenAPI openAPI, Map<String,String> userDefinedVariables)
openAPI - current OpenAPI specificationuserDefinedVariables - User overrides for server variable templatingCopyright © 2021. All rights reserved.