Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item "Extension" type. #86

Open
NfNitLoop opened this issue May 1, 2022 · 0 comments
Open

Item "Extension" type. #86

NfNitLoop opened this issue May 1, 2022 · 0 comments

Comments

@NfNitLoop
Copy link
Owner

Add a freeform "extensions" field in the Item type so that third-party apps can add additional (meta)data to Items in an easily discoverable way.


There's nothing stopping someone from shoving more data into an Item as it is, since protobuf if designed to ignore fields it doesn't (yet) know about. But leaving it up to folks to choose how to do that will possibly lead to collisions, and also make it hard to discover how to parse the embedded data.

I'm thinking something like this:

message Item {
    // ...

    // A place for third-party clients to add any additional metadata they wish.
    // the string key is the name of your extension.
    // Ex: if you have a client called "Foo" and a feature called "Bar Baz", use the format:
    // "foo:bar-baz"
    // Or, you could just use an extension name for your client ("foo") and map 
    // its various values to message properties inside of that object:  
    map <string, AnyMessage> extensions = // ...
}

message AnyMessage {
    // This space left blank. You may specify any fields you wish in your extension.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant