renderSpec renders the live OpenAPI document and unmarshals it into a generic map so the review-hardening contract tests can assert on operations + schemas without a typed OpenAPI model.
(t *testing.T)
| 10 | // map so the review-hardening contract tests can assert on operations + schemas |
| 11 | // without a typed OpenAPI model. |
| 12 | func renderSpec(t *testing.T) map[string]any { |
| 13 | t.Helper() |
| 14 | y, err := New(Deps{}).OpenAPIYAML() |
| 15 | if err != nil { |
| 16 | t.Fatalf("render spec: %v", err) |
| 17 | } |
| 18 | var doc map[string]any |
| 19 | if err := yaml.Unmarshal(y, &doc); err != nil { |
| 20 | t.Fatalf("unmarshal spec: %v", err) |
| 21 | } |
| 22 | return doc |
| 23 | } |
| 24 | |
| 25 | // operationResponses finds the operation with the given operationId anywhere in |
| 26 | // paths and returns its responses map. |
no test coverage detected