Serde: use container #[serde(default)], but with some required fields

后端 未结 0 2026
天涯浪人
天涯浪人 2021-01-22 18:36

I have a struct that uses the #[serde(default)] container attribute.

But there is one field that should be required (if this field doesn\'t exist in the incoming data, th

相关标签:
回答
  • 消灭零回复
提交回复
热议问题