Returns the C# type for a method's result, accounting for nullable anyOf wrappers and opaque JSON.
(method: RpcMethod)
| 1458 | |
| 1459 | /** Returns the C# type for a method's result, accounting for nullable anyOf wrappers and opaque JSON. */ |
| 1460 | function resolvedResultTypeName(method: RpcMethod): string { |
| 1461 | const schema = getMethodResultSchema(method); |
| 1462 | if (!schema) return resultTypeName(method); |
| 1463 | if (isOpaqueJson(schema)) return "object"; |
| 1464 | const inner = getNullableInner(schema); |
| 1465 | if (inner) { |
| 1466 | if (isOpaqueJson(inner)) return "object?"; |
| 1467 | // Nullable wrapper: resolve the inner $ref type name with "?" suffix |
| 1468 | const innerName = inner.$ref |
| 1469 | ? typeToClassName(refTypeName(inner.$ref, rpcDefinitions)) |
| 1470 | : getRpcSchemaTypeName(inner, resultTypeName(method)); |
| 1471 | return `${innerName}?`; |
| 1472 | } |
| 1473 | return resultTypeName(method); |
| 1474 | } |
| 1475 | |
| 1476 | /** Returns the ValueTask<T> or ValueTask string for an incoming-handler's result type. */ |
| 1477 | function handlerTaskType(method: RpcMethod): string { |
no test coverage detected
searching dependent graphs…