paramFor converts the given attribute into a OpenAPI spec parameter.
(att *expr.AttributeExpr, name, in string, required bool, rand *expr.ExampleGenerator)
| 59 | |
| 60 | // paramFor converts the given attribute into a OpenAPI spec parameter. |
| 61 | func paramFor(att *expr.AttributeExpr, name, in string, required bool, rand *expr.ExampleGenerator) *Parameter { |
| 62 | param := &Parameter{ |
| 63 | Name: name, |
| 64 | In: in, |
| 65 | Description: att.Description, |
| 66 | AllowEmptyValue: in != "path", |
| 67 | Required: required, |
| 68 | Schema: newSchemafier(rand).schemafy(att), |
| 69 | Extensions: openapi.ExtensionsFromExpr(att.Meta), |
| 70 | } |
| 71 | initExamples(param, att, rand) |
| 72 | return param |
| 73 | } |
no test coverage detected