json - JSON 模式中 "description"字段的用途是什么?

标签 json jsonschema

我不确定 JSON 模式“描述”字段的目的是什么。该字段是否用作评论空间?该字段是否用作 ID?

{
    "id": "http://www.noodle.org/entry-schema#",
    "schema": "http://json-schema.org/draft-04/schema#",
    "description": "schema for online courses",
    "type": "object",
    "properties": {
        "institution": {
            "type": "object",
           "$ref" : "#/definitions/institution" 
        },
        "person": {
            "type": "object",
            "items": {
                "type": "object",
                "$ref": "#/definitions/person"
            }   
    "definitions": {        
        "institution": {
            "description": "University",
            "type": "object",
            "properties": {
                "name":{"type":"string"},
                "url":{
                    "format": "uri",
                    "type": "string"
                },
                "descriptionofinstitution":{"type":"string"},
                "location": {
                    "description": "location",
                "type": "string",
                "required": true
                }
        }

}

最佳答案

根据 JSON-Schema 规范 (http://json-schema.org/latest/json-schema-validation.html#anchor98),“描述”(和“标题”)字段的目的是用有关该用户界面生成的数据的信息来装饰用户界面。标题最好是简短的,而描述将提供有关此模式描述的实例的目的的解释。

关于json - JSON 模式中 "description"字段的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17238270/

相关文章:

java - Json 模式要求节点处于错误级别

java - 使用 Java 从 JSON 生成 JSON 模式

javascript - 如何使用带有 Ajv 的正则表达式验证字符串?

json - Flutter - 解析 Json 的最佳方法是什么?

java - 用java中的另一个字符串替换JSON字符串

php - Android 无法从 php 获取正确的查询结果

jsonschema - 使用额外的必填字段扩展 $ref

javascript - Node postgres 并获取具有重复名称的连接字段

jquery - 如何在mvc中使用jquery渲染 View ?

python - jsonschema 去掉未知字段