知识卡片

普通读书笔记卡 · 3486

JSONSchema描述结构

理解等级:初级

JSON Schema 用规则描述 JSON 文档的结构,以及属性的类型和格式。它使接口两端知道载荷应包含哪些字段、这些字段如何解释,也能作为验证交换数据的依据。OpenAPI 在描述请求和响应模型时借用这类结构规则。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Microservice APIs》第 5 章《Documenting REST APIs with OpenAPI》(源文件:_epub-src/OEBPS/Text/05.htm) - 结论依据:原文把 JSON Schema 定义为描述文档结构、属性类型和格式的规范,并说明 OpenAPI 用其表达 API 属性与数据校验。 - 原始内容:JSON Schema is a specification standard for defining the structure of a JSON document and the types and formats of its properties. OpenAPI uses JSON Schema to describe the properties of an API. ... JSON Schema allows us to be very explicit with respect to the data types and formats that both the server and the client should expect from a payload.