successStatus picks the first documented 2xx status.
(responses *openapi3.Responses)
| 84 | |
| 85 | // successStatus picks the first documented 2xx status. |
| 86 | func successStatus(responses *openapi3.Responses) (string, *openapi3.ResponseRef) { |
| 87 | for _, code := range documentedStatuses(responses) { |
| 88 | if strings.HasPrefix(code, "2") { |
| 89 | return code, responses.Value(code) |
| 90 | } |
| 91 | } |
| 92 | return "", nil |
| 93 | } |
| 94 | |
| 95 | // pickExample returns a copy of the example for a response body, preferring |
| 96 | // the one named default. |
no test coverage detected