-
Notifications
You must be signed in to change notification settings - Fork 22
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 Barber API protos to support more dynamic functionality #51
Conversation
62e19ea
to
a7ef3a3
Compare
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.
LGTM
*/ | ||
optional string template_token = 1; | ||
/* The context values required to render a DocumentTemplate of the given template_id */ | ||
repeated Field fields = 2; |
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.
Nit: Do we have an internal guideline on whether repeated field names should have the trailing "s"?
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.
We do. This is right!
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.
I don't think so but I'll defer to @swankjesse or others if they have opinions
*/ | ||
optional string template_token = 1; | ||
/* The context values required to render a DocumentTemplate of the given template_id */ | ||
repeated Field fields = 2; |
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.
We do. This is right!
/* A unique identifier used for lookup */ | ||
optional string template_token = 1; | ||
/* An auto-incrementing integer to identify a unique version of the same DocumentTemplate */ | ||
optional int64 version = 2; |
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.
is this available?
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.
It will be used by a CMS service soon so adding it now in advance
/* An auto-incrementing integer to identify a unique version of the same DocumentTemplate */ | ||
optional int64 version = 2; | ||
/* Locale language that the DocumentTemplate is written in */ | ||
optional string locale = 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.
For formality, wanna specify that this is an RFC 5646 language tag?
https://tools.ietf.org/html/rfc5646#appendix-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.
(or whatever spec this interlocks with on the other side)
a7ef3a3
to
6863d8c
Compare
Proto versions of
DocumentData
andDocumentTemplate
will provide for easier usage of Barber within APIs and events that can leverage Wire for over-the-wire encoding.Notably,
Document
will remain as a non-proto implemented Kotlin data class in order to provide more precise configuration of per field output encoding using@BarberField
annotations.