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

Function schemaProps

internal/httpapi/spec_review_test.go:48–58  ·  view source on GitHub ↗

schemaProps returns the properties map of a named component schema.

(t *testing.T, doc map[string]any, schemaName string)

Source from the content-addressed store, hash-verified

46
47// schemaProps returns the properties map of a named component schema.
48func schemaProps(t *testing.T, doc map[string]any, schemaName string) map[string]any {
49 t.Helper()
50 comps, _ := doc["components"].(map[string]any)
51 schemas, _ := comps["schemas"].(map[string]any)
52 sc, ok := schemas[schemaName].(map[string]any)
53 if !ok {
54 t.Fatalf("schema %q not found in spec", schemaName)
55 }
56 props, _ := sc["properties"].(map[string]any)
57 return props
58}
59
60// enumOf returns the enum string slice for a property, or nil if absent.
61func enumOf(props map[string]any, field string) []string {

Calls

no outgoing calls

Tested by

no test coverage detected