resolveURL replaces :key placeholders in url with path-escaped values from extra.
(rawURL string)
| 100 | |
| 101 | // resolveURL replaces :key placeholders in url with path-escaped values from extra. |
| 102 | func (d *DryRunAPI) resolveURL(rawURL string) string { |
| 103 | for k, v := range d.extra { |
| 104 | rawURL = strings.ReplaceAll(rawURL, ":"+k, url.PathEscape(fmt.Sprintf("%v", v))) |
| 105 | } |
| 106 | return rawURL |
| 107 | } |
| 108 | |
| 109 | // MarshalJSON serializes as {"description": "...", "api": [...calls with resolved URLs], ...extra}. |
| 110 | func (d *DryRunAPI) MarshalJSON() ([]byte, error) { |
no outgoing calls
no test coverage detected