(at *expr.AttributeExpr, name, in string, required bool)
| 310 | } |
| 311 | |
| 312 | func paramFor(at *expr.AttributeExpr, name, in string, required bool) *Parameter { |
| 313 | alias := at |
| 314 | at = resolvedAliasAttribute(at) |
| 315 | p := &Parameter{ |
| 316 | In: in, |
| 317 | Name: name, |
| 318 | Default: openapi.ToStringMap(at.DefaultValue), |
| 319 | Description: at.Description, |
| 320 | Required: required, |
| 321 | } |
| 322 | p.Type, p.Format = openAPITypeFormat(at) |
| 323 | if expr.IsArray(at.Type) { |
| 324 | p.Items = itemsFromExpr(expr.AsArray(at.Type).ElemType) |
| 325 | p.CollectionFormat = "multi" |
| 326 | } |
| 327 | p.Extensions = openapi.ExtensionsFromExpr(at.Meta) |
| 328 | initAttributeValidations(alias, p) |
| 329 | return p |
| 330 | } |
| 331 | |
| 332 | func itemsFromExpr(at *expr.AttributeExpr) *Items { |
| 333 | itemType, itemFormat := openAPITypeFormat(at) |
no test coverage detected