@CompileStatic class UrlMappingPaths extends java.lang.Object
Converts the pattern of a Grails URL mapping to the OpenAPI paths it serves.
An OpenAPI path variable is always required, so a mapping with an optional variable, such as
"/photos/$id?", serves two paths: one with the variable and one without. A mapping with
a wildcard that captures nothing, such as "/**", matches paths that cannot be written as
an OpenAPI path and serves none.
| Constructor and description |
|---|
UrlMappingPaths() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static void |
constrain(io.swagger.v3.oas.models.media.Schema<?> schema, UrlMapping mapping, java.lang.String name)Applies what the mapping constrains a variable to: the pattern it must match, where the variable is described as a string, and the values it must be one of. |
|
static boolean |
isOptional(UrlMapping mapping, java.lang.String name)Whether a variable of the mapping may be left out of a request, as $action? |
|
static java.util.List<java.lang.String> |
paths(UrlMapping mapping, java.util.Map<java.lang.String, java.lang.String> substitutions, java.util.Set<java.lang.String> omitted)
|
|
static java.util.List<java.lang.String> |
templateVariables(java.lang.String path)The variables a path declares, so every one of them is described and none that is absent is. |
|
static java.util.List<java.lang.String> |
variableNames(UrlMapping mapping)The names of the variables a mapping binds, in the order its pattern declares them. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Applies what the mapping constrains a variable to: the pattern it must match, where the variable is described as a string, and the values it must be one of.
Whether a variable of the mapping may be left out of a request, as $action? may.
mapping - the mapping to describesubstitutions - the value a variable is fixed to, such as the controller a default
mapping is expanded foromitted - the variables the described action does not address; the segment each sits
in is left outThe variables a path declares, so every one of them is described and none that is absent is.
The names of the variables a mapping binds, in the order its pattern declares them.