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

@Protobuf的order属性是否应该为必选? #13

Closed
amsz opened this issue Feb 12, 2015 · 4 comments
Closed

@Protobuf的order属性是否应该为必选? #13

amsz opened this issue Feb 12, 2015 · 4 comments

Comments

@amsz
Copy link

amsz commented Feb 12, 2015

在协议定义时,字段顺序通常是明确的,使用默认值时如果不小心在中间新加了一个字段,就会造成协议不兼容,是否可以考虑设置必选?

另外,是否可以考虑order不定义的话,忽略该字段?

@jhunters
Copy link
Owner

这个方案也是之前考虑到大家使用上的便捷考虑的,所以暂时不会进行方案调整,从推荐的使用方法上是建议大家使用时明确指定order的内容

@amsz
Copy link
Author

amsz commented Feb 12, 2015

一个对象中,如果某些字段定义了@protobuf,还有些字段没有定义@protobuf,没有定义@protobuf的字段会被忽略,是这样吗?

@jhunters
Copy link
Owner

是的,只会针对@protobuf注解定义字段有效

@amsz
Copy link
Author

amsz commented Feb 12, 2015

谢谢你的答复

@amsz amsz closed this as completed Feb 12, 2015
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

No branches or pull requests

2 participants