-
Notifications
You must be signed in to change notification settings - Fork 620
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
Add some documentation for ProtoBufSchemaGenerator in formats.md #1855
Add some documentation for ProtoBufSchemaGenerator in formats.md #1855
Conversation
docs/formats.md
Outdated
### ProtoBuf schema generator (experimental) | ||
|
||
As mentioned above, when working with protocol buffers you usually use a ".proto" file and use a code generator for your | ||
language includes the code to your message to an output stream and deserialize it from an input stream. When using |
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.
your language includes
Something is missing before 'includes', at least a comma
input stream. When using
Two spaces instead of one
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.
Thanks I'm sure I proof read it multiple times but then committed total nonsense.
docs/formats.md
Outdated
Kotlin Serialization this step is not necessary because your `@Serializable` Kotlin data types are used as the source | ||
for the schema. | ||
|
||
This is very convenient for Kotlin-to-Kotlin communication, but makes interoperability between languages complicated. Fortunately you can use to output the ".proto" representation of your messages. You can keep your Kotlin classes as a |
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.
Fortunately, you can use SOMETHIING to output the ".proto" representation of your messages.
SOMETHING is missing
val schemas = ProtoBufSchemaGenerator.generateSchemaText(descriptors) | ||
println(schemas) | ||
``` | ||
|
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.
Knit uses several magic lines, and
> You can get the full code [here](../guide/example/example-formats-07.kt).
is one of them you should insert here. Don't worry, number of example would be automatically updated by a knit task.
optional string department = 3; | ||
} | ||
``` | ||
|
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.
Test output should be finished with <!--- TEST -->
knit directive
Have you re-run |
I'm sorry I missed that step. I have run it now and updated the PR. |
Your example should be separate compilable unit:
I suggest adding |
Thanks for your patience! I wasn't familiar with what knit did. Have now fixed the knit related issues. |
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.
Thanks for all your efforts and time!
Hi, this is a PR for #1778
I've added a bit of documentation in
formats.md
about theProtoBufSchemaGenerator
. Just enough to help the interested party see that it exists, an example and a link to the code.If you think it will be useful I'll be happy to make any requested changes.
It is targeted at master since it is documentation only, but it looks like it will cleanly merge with dev if you prefer.
BTW Knit fails with the following, I'm not sure why.