-
Notifications
You must be signed in to change notification settings - Fork 490
Add options and option extensions #376
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
Conversation
Seems like this has been forgotten? The main work is now merged in pseudomuto/protokit |
It's not forgotten, I see it every time when I click on "Pull Requests" in Github's top bar 😉 This PR is just waiting for @pseudomuto, and I suspect he's been a bit busy. From his Github activity I suspect that he just returned from a holiday, so maybe he'll find time for it soon. Everything is basically done, so moving forward, we need to:
|
The ability to emit field/service/method/enum options in json output would be fantastically useful to us (currently using a forked protobuf.js to achieve this). Looking forward to progress! |
My apologies for the long-delayed response here. Between vacation, conferences, and work I haven't had enough free time to review this. Good news is, I've got time this week. I'll make sure I've got this reviewed by the end of the week. |
It didn't look like @pseudomuto reviewed this yet, so I took the liberty of adding support for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I apologize for the length of time it took to review. I'll get the new protokit (0.2.0) released right now.
Once you've got the pinned version and the extra volume in the docker command we can merge this right away.
@@ -0,0 +1,35 @@ | |||
// Package extensions implements a system for working with extended options. | |||
package extensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Released! - https://github.com/pseudomuto/protoc-gen-doc/releases/tag/v1.3.0 Thanks again for the PR @htdvisser! |
This is a great addition thanks!... Sadly only outputs for the HTML template. |
@rogchap if you want to submit a pull request, feel free to get inspired by the markdown template I wrote for TheThingsNetwork/lorawan-stack |
ping @pseudomuto
This pull request builds on top of pseudomuto/protokit#2 and pseudomuto/protokit#4 to add support for options and extended options in files, services, methods, enums, enum values, messages and fields.
It supports two builtin protobuf options:
deprecated
(as asked in Add field/message/service options support #233 (comment))idempotency_level
(available on Methods)and three external extensions:
validator.field
for go-proto-validators.validate.rules
for protoc-gen-validate.google.api.http
for grpc-gateway.Notes
Right now for
validator.field
we use reflection to transform the field validation rules, but it could be nice to generate the code for that fromvendor/github.com/mwitkow/go-proto-validators/validator.proto
.I'm currently importing
github.com/pseudomuto/protokit/fixtures/extend.proto
, maybe it's cleaner to copy it.