Conversation
There was a problem hiding this comment.
I think you also need to add something to schemas/? and json_schema too ideally.
| option go_package = "aep.dev/api"; | ||
|
|
||
| // Provides a generic wrapper for all webhook notifications. | ||
| message Notification { |
There was a problem hiding this comment.
thoughts on making this compatible with https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md?
| // The payload of the notification. | ||
| // | ||
| // The type of this payload should directly correspond to the event type. | ||
| google.protobuf.Any payload = 4; |
There was a problem hiding this comment.
doesn't this have the same problem as any other .Any where you don't know the schema? and therefore you need some sort of side-documentation that isn't statically verified like JsonSchema?
seems like a pattern for defining webhook schema would be better than an actual type.
| // // This notification is sent when a GroupJoinRequest is created; that is, | ||
| // // when a user requests to join a group. | ||
| // message BookArchived { | ||
| // option (aep.api.webhook_payload) = { |
There was a problem hiding this comment.
OOC - how are webhooks supposed to work in gRPC?
I feel like protobufs will only work when your server defines and RPC schema that the client knows how to send requests to - theoretically I guess the gRPC protocol does send over HTTP/2 so you as long as your message is packed via protobuf and the request payload matches someone could send a payload to you.
I suppose that's also the motivation for using protobuf.Any? you can send any payload type you want to and leave it to the webhook received to cast the object appropriately?
Corresponding guidance added in aep-dev/aeps#209.