-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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.
clord
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request