MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / TestSchemaForMessage_AllScalarKinds

Function TestSchemaForMessage_AllScalarKinds

internal/mcp/schema_test.go:66–72  ·  view source on GitHub ↗

TestSchemaForMessage_ScalarOnly walks a request that's purely scalars (no nested message). Profile takes no arguments at all; Session takes a few list-of-string + nested PermissionInput.

(t *testing.T)

Source from the content-addressed store, hash-verified

64// (no nested message). Profile takes no arguments at all; Session takes
65// a few list-of-string + nested PermissionInput.
66func TestSchemaForMessage_AllScalarKinds(t *testing.T) {
67 md := (&authorizerv1.ValidateJwtTokenRequest{}).ProtoReflect().Descriptor()
68 s := schemaForMessage(md)
69 assert.Equal(t, "string", s.Properties["token_type"].Type)
70 assert.Equal(t, "string", s.Properties["token"].Type)
71 assert.Equal(t, "array", s.Properties["roles"].Type)
72}
73
74// TestSchemaForMessage_CheckPermissionsNesting proves the generator handles
75// the two-level nesting introduced by the OpenFGA dual-API:

Callers

nothing calls this directly

Calls 3

schemaForMessageFunction · 0.85
DescriptorMethod · 0.45
ProtoReflectMethod · 0.45

Tested by

no test coverage detected