Skip to content
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

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

adrw
Copy link
Collaborator

@adrw adrw commented Oct 5, 2020

Proto versions of DocumentData and DocumentTemplate 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.

@adrw adrw requested a review from swankjesse October 5, 2020 20:27
@adrw adrw force-pushed the adrw/20201005.addBarberProtoApi branch from 62e19ea to a7ef3a3 Compare October 5, 2020 20:35
Copy link
Collaborator

@ejao1 ejao1 left a 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;
Copy link
Collaborator

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"?

Copy link
Collaborator

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!

Copy link
Collaborator Author

@adrw adrw Oct 5, 2020

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

@adrw adrw requested review from wesleyk and zcross October 5, 2020 21:25
*/
optional string template_token = 1;
/* The context values required to render a DocumentTemplate of the given template_id */
repeated Field fields = 2;
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this available?

Copy link
Collaborator Author

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;
Copy link
Collaborator

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

Copy link
Collaborator

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)

@adrw adrw force-pushed the adrw/20201005.addBarberProtoApi branch from a7ef3a3 to 6863d8c Compare October 6, 2020 14:07
@adrw adrw merged commit 0f34a18 into master Oct 6, 2020
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.

3 participants