* Return the params class name if the method has a params schema with properties * other than sessionId (i.e. there are user-supplied parameters).
(method: RpcMethodNode)
| 1655 | * other than sessionId (i.e. there are user-supplied parameters). |
| 1656 | */ |
| 1657 | function wrapperParamsClassName(method: RpcMethodNode): string | null { |
| 1658 | let params = method.params; |
| 1659 | if (params?.$ref) params = resolveRef(params) as JSONSchema7; |
| 1660 | if (!params || typeof params !== "object") return null; |
| 1661 | const props = params.properties ?? {}; |
| 1662 | const userProps = Object.keys(props).filter((k) => k !== "sessionId"); |
| 1663 | if (userProps.length === 0) return null; |
| 1664 | return rpcMethodToClassName(method.rpcMethod) + "Params"; |
| 1665 | } |
| 1666 | |
| 1667 | /** True if the method's params schema contains a "sessionId" property */ |
| 1668 | function methodHasSessionId(method: RpcMethodNode): boolean { |
no test coverage detected
searching dependent graphs…