知识卡片

普通读书笔记卡 · 3481.e

模式标识辅助消息路由

理解等级:中级

没有语义profile与结构化媒体类型时,可以把schema URI当作消息种类标识,路由到相应解析器。标识可能位于正文$schema、服务约定的头或媒体类型参数;URI不一定可解引用,可访问的URL则方便人查阅。

这不同于把入站正文完整套进严格schema校验:额外字段或次序差异可能无碍当前任务。书中Accept-Schema/Schema协商来自过期提案,不是普遍协议能力;媒体类型参数也须遵守对应格式规则,不能任意添加。

关联:[[按媒体类型分派解析]]。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体客户端 · 查看原书依据

      The primary value of schema documents comes into play when you are creating and sending messages (see Recipe 4.12). However, client applications can also use the schema document identifiers themselves (URLs or URIs) as advisory values for processing incoming messages. Essentially, schema identifiers become confirmation values that the response received by the client will contain the information the client will need to perform its work.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook》第4章《Hypermedia Clients》(来源项目book-sources:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch04.xhtml,配方4.7) - 结论依据:原文把schema标识作为入站消息的辅助确认与路由信息,区分它和严格全文验证。 - 原始内容:The primary value of schema documents comes into play when you are creating and sending messages (see Recipe 4.12). However, client applications can also use the schema document identifiers themselves (URLs or URIs) as advisory values for processing incoming messages. Essentially, schema identifiers become confirmation values that the response received by the client will contain the information the client will need to perform its work.