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

Fix primitive extensions issues #44

Merged
merged 5 commits into from
May 20, 2017

Conversation

guptasu
Copy link
Contributor

@guptasu guptasu commented May 18, 2017

Auto generate extensions for primitive types of extension schema.

Extensions are represented google.protobuf.Any type. But Any types can only represent Message types within them. Therefore we will need to use wrapper types to convert primitives into google.protobuf.Any when reading an extension of type int/string etc.

Please look at the examples on how to declare extensions of primitive types.

…being a yaml.mapslice

In case of extension of primitive types (int, string etc.), they are not of type mapslice. a general interface {} type just works fine for our purpose.
For primitive extension, we cannot unmarshal to yaml.mapslice. Therefore, unmarshaling of yamlString has to happen per extension.
…ct to the individual extension handlers.

Last commit 854416b should have included this change, accidentally missed it.
@guptasu guptasu requested a review from timburks May 18, 2017 21:46
@timburks timburks changed the title Fix primitive extenions issue Fix primitive extensions issues May 19, 2017
@timburks timburks merged commit 4093ca8 into google:master May 20, 2017
Copy link
Contributor

@timburks timburks left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

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.

None yet

2 participants