-
Notifications
You must be signed in to change notification settings - Fork 6
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
Detail generating code in the Readme #54
Detail generating code in the Readme #54
Conversation
# <snip> | ||
plugins: | ||
- plugin: buf.build/protocolbuffers/python:v23.4 | ||
out: gen |
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.
doesn't this need an option to generate included protos too?
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.
actually it looks like you need https://buf.build/docs/reference/cli/buf/generate/#include-imports
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.
looks like you either need to use https://buf.build/docs/reference/cli/buf/generate/#include-imports or manually generate the files using https://github.com/bufbuild/protovalidate-python/blob/main/Makefile#L39
README.md
Outdated
@@ -71,6 +80,81 @@ message Transaction { | |||
} | |||
``` | |||
|
|||
### Generating Code |
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 feels a longer-winded than necessary. I definitely wouldn't suggest people experiment with both buf and protoc 😛
Instead of a whole section about this, just make it clear above that to use the runtime library after pip install
, they also need to generate the Python code for the core buf.protovalidate
Protobuf package, and provide examples using buf
. (I would leave protoc
as an exercise for the reader: after all, very few people using protoc
use it directly but usually have their own tooling around it or maybe use bazel
.)
With buf
, you can suggest that using --include-imports
flag will probably do what they need or suggest they separately run buf generate buf.build/bufbuild/protovalidate
.
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.
hows 62a6014?
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.
Better. Ship it!!
#48 highlights there may be some documentation gap in generating code, I propose a detailed
generating code
section to combat this