Param describes a single HTTP request path or query string parameter. Param must appear in the API HTTP expression (to define request parameters common to all the API endpoints), a service HTTP expression to define common parameters to all the service methods or a specific method HTTP expression. P
(name string, args ...any)
| 713 | // }) |
| 714 | // }) |
| 715 | func Param(name string, args ...any) { |
| 716 | p := params(eval.Current()) |
| 717 | if p == nil { |
| 718 | eval.IncompatibleDSL() |
| 719 | return |
| 720 | } |
| 721 | if name == "" { |
| 722 | eval.ReportError("parameter name cannot be empty") |
| 723 | } |
| 724 | eval.Execute(func() { Attribute(name, args...) }, p.AttributeExpr) |
| 725 | p.Remap() |
| 726 | } |
| 727 | |
| 728 | // MapParams describes the query string parameters in a HTTP request. |
| 729 | // |