( method: RpcMethod, context: DefinitionCollections | RustCodegenCtx, )
| 1304 | } |
| 1305 | |
| 1306 | function rustParamsTypeName( |
| 1307 | method: RpcMethod, |
| 1308 | context: DefinitionCollections | RustCodegenCtx, |
| 1309 | ): string { |
| 1310 | const ctx = "externalTypeRefs" in context ? context : undefined; |
| 1311 | const defCollections = ctx?.definitions ?? context; |
| 1312 | const params = method.params as (JSONSchema7 & { $ref?: string }) | undefined; |
| 1313 | if (typeof params?.$ref === "string") { |
| 1314 | if (ctx) { |
| 1315 | recordExternalRustTypeRef(params.$ref, ctx); |
| 1316 | } |
| 1317 | return rustRefTypeName(params.$ref, defCollections); |
| 1318 | } |
| 1319 | |
| 1320 | const resolved = params ? resolveSchema(params, defCollections) : undefined; |
| 1321 | return getRpcSchemaTypeName( |
| 1322 | resolved ?? params, |
| 1323 | `${toPascalCase(method.rpcMethod)}Params`, |
| 1324 | ); |
| 1325 | } |
| 1326 | |
| 1327 | function rustResultTypeName(method: RpcMethod, ctx: RustCodegenCtx): string { |
| 1328 | if (method.result?.$ref && parseExternalSchemaRef(method.result.$ref)) { |
no test coverage detected
searching dependent graphs…