We built our own in-house RPC interface definition pipeline where the schemas are just typescript types, looking very similar to the example in your post
interface MyService {
method(): ReturnType;
}
We parse the typescript to JSON Schema, then use that to generate runtime validation across both JS implementations and other languages.
Typescript is a really nice IDL. I didn't want to hitch our wagon to something else like typespec.io even if that would have given us more things out of the box.
Typescript is a really nice IDL. I didn't want to hitch our wagon to something else like typespec.io even if that would have given us more things out of the box.