IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Json Schema 再学习及相应工具

    admin发表于 2016-05-04 03:08:18
    love 0

    Json Schema 再学习

    嵌套

    {
        "$schema": "http://json-schema.org/schema#",
        "title": "详情页",
        "description": "详情页相关",
        "type": "object",
        "properties": {
            "pictures": {
                "type": "array",
                "title": "商品图片列表",
                "items": {
                    "type": "string"
                },
                "minItems": 3
            },
            "title": {
                "type": "string",
                "title": "商品标题"
            },
            "price": {
                "type": "number",
                "title": "商品价格",
                "minimum": 0,
                "maximum": 100
            },
            "percentage": {
                "type": "number",
                "title": "百分比"
            },
            "info": {
                "type": "string",
                "title": "商品介绍"
            },
            "remmGoods": {
                "type": "array",
                "title": "推荐商品列表",
                "items": {
                    "type": "object",
                    "properties": {
                        "title": {
                            "type": "string",
                            "title": "商品标题"
                        },
                        "icon": {
                            "type": "string",
                            "title": "商品icon"
                        },
                        "price": {
                            "type": "number",
                            "title": "商品价格",
                            "minimum": 0,
                            "maximum": 100
                        },
                        "percentage": {
                            "type": "number",
                            "title": "百分比"
                        }
                    }
                },
                "minItems": 1
            }
        }
    }

    相应工具及简要说明:

    Json Schema 验证器,用于验证JSON Schema和JSON Document是否一致。当有问题时,会有错误提示。
    http://jsonschemalint.com/

    理解 JSON Schema,学习JSON Schema很棒的教程,还有实例。
    http://spacetelescope.github.io/understanding-json-schema/index.html

    dream.js 是一个轻量级的 JSON 数据生成器
    https://github.com/adleroliveira/dreamjs

    chance.js 为JavaScript生成指定格式的随机值
    http://chancejs.com/

    json介绍,由两种形式组成,对象和数组。
    对象:“名称/值”对的集合
    数组:值的有序列表
    json介绍


    © admin for 可乐吧, 2016. | Permalink | No comment | Add to del.icio.us
    Post tags:

    您可能也喜欢:
    JSON Schema学习
    laravel 学习 Schema 小记
    json学习小记
    JSON到底是什么?
    无觅

    Feed enhanced by Better Feed from Ozh



沪ICP备19023445号-2号
友情链接