urlPlaceholders returns the set of variable names referenced as `{name}` placeholders in a Server URL template, deduplicated.
(url string)
| 25 | // urlPlaceholders returns the set of variable names referenced as |
| 26 | // `{name}` placeholders in a Server URL template, deduplicated. |
| 27 | func urlPlaceholders(url string) map[string]struct{} { |
| 28 | matches := serverURLPlaceholderRE.FindAllStringSubmatch(url, -1) |
| 29 | if len(matches) == 0 { |
| 30 | return nil |
| 31 | } |
| 32 | set := make(map[string]struct{}, len(matches)) |
| 33 | for _, m := range matches { |
| 34 | set[m[1]] = struct{}{} |
| 35 | } |
| 36 | return set |
| 37 | } |
| 38 | |
| 39 | // ServerObjectDefinition defines the definition of an OpenAPI Server object (https://spec.openapis.org/oas/v3.0.3#server-object) as it is provided to code generation in `oapi-codegen` |
| 40 | type ServerObjectDefinition struct { |
no outgoing calls