首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何用MSON定义ApiBlueprint数组值的例子?

如何用MSON定义ApiBlueprint数组值的例子?
EN

Stack Overflow用户
提问于 2017-11-08 21:04:32
回答 1查看 232关注 0票数 0

我可以使用MSON来指定一个示例值而不是+ Body吗?是否可以覆盖预定义的结构值?

我试过这样做:

代码语言:javascript
复制
+ Request (application/json)

    + Headers

            Authorization: JWT <token>    
    + Attributes (ClientsideCommand)
        + alias: `show-xc`
        + args (array[AppCommandArg], fixed-type)
            + (AppCommandArg)
                + arg_key: address
                + order: 1
                + required: true
                + skip_arg_name: true
            + (AppCommandArg)
                + arg_key: `-A1`
                + order: 2
                + required: true
                + skip_arg_name: false

但是这样的定义破坏了json模式,因为AppCommandArg被描述为单独的对象。并且在由MSON生成的JSON中有3个项目,其中第一个项目是默认的AppCommandArg

EN

回答 1

Stack Overflow用户

发布于 2017-11-16 22:26:47

看起来不可能把这两样东西放在一起。如果您添加元素,如上文所示,则Apiary会按它看到的方式呈现它,如果一个元素注释了两次,则json模式也会对其进行两次描述。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47180503

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档