rekmarks / ts-to-open-rpc

A command line utility for converting TypeScript interfaces to OpenRPC interface descriptions.
MIT License
4 stars 2 forks source link

Document return values for void methods in OpenRPC #1

Open rekmarks opened 3 years ago

rekmarks commented 3 years ago

I.e., methods where response.result is null or undefined.

rekmarks commented 3 years ago

@BelfordZ, how should I do this according to the spec?

BelfordZ commented 3 years ago

@rekmarks JSON Schema has a null type. You can make a content descriptor whose json schema type is null. As for undefined, you can put schema: true, since any result is ultimately valid there. Not super ideal way to handle undefined... ill try to think of a better one.

BelfordZ commented 3 years ago

this looks great BTW. Thank you for your efforts!!