Skip to content

Conversation

htdvisser
Copy link
Contributor

@htdvisser htdvisser commented Nov 9, 2018

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:

and three external extensions:

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 from vendor/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.

@rogchap
Copy link

rogchap commented Jan 9, 2019

Seems like this has been forgotten? The main work is now merged in pseudomuto/protokit
@htdvisser @pseudomuto

@htdvisser
Copy link
Contributor Author

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:

  1. Tag a new version of protokit (@pseudomuto)
  2. Update Gopkg.toml/Gopkg.lock in this PR (@htdvisser)
  3. Review this PR (@pseudomuto)
  4. Fix things that came out of review (@htdvisser)
  5. Merge the PR (@pseudomuto)
  6. Possibly tag a new version of protoc-gen-doc (@pseudomuto)

@igrayson
Copy link

igrayson commented Mar 1, 2019

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!

@pseudomuto
Copy link
Owner

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.

@htdvisser
Copy link
Contributor Author

It didn't look like @pseudomuto reviewed this yet, so I took the liberty of adding support for the validate.rules option from github.com/lyft/protoc-gen-validate as well.

Copy link
Owner

@pseudomuto pseudomuto left a 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@htdvisser
Copy link
Contributor Author

merge

@pseudomuto pseudomuto merged commit ec3fcd0 into pseudomuto:master Apr 15, 2019
@pseudomuto
Copy link
Owner

Released! - https://github.com/pseudomuto/protoc-gen-doc/releases/tag/v1.3.0

Thanks again for the PR @htdvisser!

@rogchap
Copy link

rogchap commented May 29, 2019

This is a great addition thanks!... Sadly only outputs for the HTML template.
Need to add the changes to the other templates... selfishly the Markdown template :D

@htdvisser
Copy link
Contributor Author

@rogchap if you want to submit a pull request, feel free to get inspired by the markdown template I wrote for TheThingsNetwork/lorawan-stack

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

Successfully merging this pull request may close these issues.

4 participants