确定 Protobuf .NET 中缺失(必需)的字段

发布于 2024-10-04 15:03:37 字数 93 浏览 0 评论 0原文

在尝试将 protobuf 对象发送到服务器之前,我想确保它有效(提供了所有必填字段)。 protobuf .NET 序列化器不够严格,无法告诉我这一点 - 我有什么选择?

I want to make sure a protobuf object is valid (all required fields are provided) before I try to send it to the server. The protobuf .NET serializer is not strict enough to tell me this - what are my options?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

め七分饶幸 2024-10-11 15:03:37

这是我希望在 v2 中加强的内容,基本上是在决定写入特定字段的逻辑中注入异常。现在您需要进行外部验证。我将为此记录一个工作项目。

This is something I hope to strengthen in v2, basically be injecting an exception into the logic that decides not to write a specific field. For now you would need to verify externally. I'll go and log a work-item for this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文