知识卡片

问题卡 · 4927.a.1.c

结构与业务内容分层

理解等级:中级

结构化媒体类型规定与具体业务字段无关的容器规则,例如一组li位于ul中;增加email字段仍可符合原结构。必须区分“消息结构正确”与“业务内容有效”:能解析消息,不意味着业务必填字段齐全。这里的structured指预先定义的领域无关消息结构,不是说JSON语法本身没有结构。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体接口设计 · 查看原书依据

      Another way to think about this solution is to assume that the first task of message consumer applications is to make sure the message is well-formed—that it complies with the basic rules of how a message must be constructed. It is, however, a different task to make sure the message is valid—that the message content follows established rules for what information needs to appear within the messages (e.g., “all Person messages MUST include a givenName, familyName, and emailAddress property”).

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第03章《超媒体接口设计》(来源项目 book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch03.xhtml;小节:3.2) - 结论依据:原文以结构化媒体类型规定与具体业务字段无关的容器规则,例如一组li位于ul中;增加email字段仍可符合原结构的机制或场景为依据;同小节余文补充本卡所列条件,按2022年原书语境整理。 - 原始内容:Another way to think about this solution is to assume that the first task of message consumer applications is to make sure the message is well-formed—that it complies with the basic rules of how a message must be constructed. It is, however, a different task to make sure the message is valid—that the message content follows established rules for what information needs to appear within the messages (e.g., “all Person messages MUST include a givenName, familyName, and emailAddress property”).