MCPcopy Create free account
hub / github.com/cli/cli / successStatus

Function successStatus

script/ghmock/restscaffold.go:86–93  ·  view source on GitHub ↗

successStatus picks the first documented 2xx status.

(responses *openapi3.Responses)

Source from the content-addressed store, hash-verified

84
85// successStatus picks the first documented 2xx status.
86func 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.

Callers 1

scaffoldMethod · 0.85

Calls 2

documentedStatusesFunction · 0.85
ValueMethod · 0.80

Tested by

no test coverage detected