MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / renderSpec

Function renderSpec

internal/httpapi/spec_review_test.go:12–23  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

10// map so the review-hardening contract tests can assert on operations + schemas
11// without a typed OpenAPI model.
12func 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.

Calls 2

OpenAPIYAMLMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected