I was wondering if typical is interest in adding a third top level type (in addition to struct and choice), rpc. That way one can model their APIs in typical along side their data models. For example:
struct User {
id: String = 0
username: String = 1
}
struct CreateUserInput {
user: User = 0
}
choice CreateUserOutput {
success = 0
error: String = 1
}
rpc UserService {
createUser(CreateUserInput): CreateUserOutput
}
I can imagine asymmetric also being useful for rpc as a way to deprecate API endpoints. Where the server must implement it, but the clients must handle the case where it is gone.
rpc UserService {
# Deprecated: Use createUserV2 instead
asymmetric createUser(CreateUserInput): CreateUserOutput
createUserV2(CreateUserInputV2): CreateUserOutput
}
Or does RPC just open up a whole can of worms that typical doesn't want to deal with? My thinking is that Typical wouldn't handle the actual doing of the rpc, but the code generation would provide hooks for userland to fill in. That way the rpc could be through any user-defined protocol.
I was wondering if typical is interest in adding a third top level type (in addition to
structandchoice),rpc. That way one can model their APIs in typical along side their data models. For example:I can imagine
asymmetricalso being useful forrpcas a way to deprecate API endpoints. Where the server must implement it, but the clients must handle the case where it is gone.Or does RPC just open up a whole can of worms that
typicaldoesn't want to deal with? My thinking is that Typical wouldn't handle the actual doing of the rpc, but the code generation would provide hooks for userland to fill in. That way the rpc could be through any user-defined protocol.