kkrpc
    Preparing search index...

    Function lookupValidator

    • Look up the MethodValidators for a dotted method path (e.g. "math.grade1.add") from a validators object that mirrors the API shape.

      The validators object has the same nesting as the API:

      { math: { grade1: { add: { input: ..., output: ... } } } }
      

      This function walks down the path segments and returns the leaf node if it looks like a MethodValidators (has input or output key). Returns undefined if the path doesn't exist or lands on a namespace node (not a leaf with schemas).

      Parameters

      • validators: undefined | Record<string, unknown>

        The validators map (same shape as the API), or undefined

      • methodPath: string

        Dotted method path, e.g. "add" or "math.grade1.add"

      Returns undefined | MethodValidators<any[], any>