首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Apiary.io中显示嵌套属性定义

如何在Apiary.io中显示嵌套属性定义
EN

Stack Overflow用户
提问于 2015-05-14 11:59:53
回答 2查看 2.6K关注 0票数 9

我的数据结构定义如下:

代码语言:javascript
复制
# Data Structures

## PlayerRank (object)
Represents the minimum amount of data the the client needs to send to give rank information about a particular Player in a particular Played Game.
+ playerId (number, required) - NemeStats unique identifier for the Player.
+ gameRank (number, required) - The corresponding rank of the Player in this Played Game. A rank of 1 means the Player got first place, 2 means second place, and so on.
+ pointsScored (number, optional) - Integer number of points the Player scored in the Played Game.

我试图在另一个操作定义中使用此数据结构,如下所示:

代码语言:javascript
复制
## Create a new Played Game [POST]
This service will record a new Played Game.

+ Attributes
    + gameDefinitionId (number, required) - NemeStats unique identifier for the Game Definition (e.g. Race For the Galaxy's unique Id) of the Played Game.
    + datePlayed (string, optional) - The date the game was played in yyyy-MM-dd format (e.g. 2015-04-29).
    + notes (string, optional) - Any notes or comments that the User wants to record about the game for future reference.
    + playerRanks (array[PlayerRank], required) - A collection of PlayerRank objects specifying the game rank and points scored for each Player. See below table for details.

我想要做的是让Apiary.io文档不仅显示顶级属性的定义,还显示PlayerRank对象的属性定义。作为一个试图理解UI的开发人员,我希望看到每个对象和字段的定义,因此我知道如何正确地形成一个请求。现在,它只给出了playerRanks对象的描述,即:“指定每个玩家的游戏级别和得分的PlayerRank对象集合。”但是它并没有扩展定义来显示PlayerRank数据结构的所有属性。

您知道Apiary.io文档是否可以帮助这一点吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-10-18 08:55:45

现在,Apiary,API蓝图支持嵌套对象,例如,您可以定义如下

代码语言:javascript
复制
+ Attributes (object)
    + name: iPhone 6 / 6s (string, required) - Offer Name
    + price: 10.4 (number) - Offer price
        can be a number with 2 decimal places, this is the sale price   
    + offer_options (object)
        + option_name: black (string, required) - offer option name
        + max_qty: 0 (number) - Purchase limit to this quantity
票数 4
EN

Stack Overflow用户

发布于 2015-05-15 10:54:59

AFAIK这是一个测试版,用户界面还没有完成,请参阅这个github问题获得更多信息,并对未来进行预览。

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

https://stackoverflow.com/questions/30236863

复制
相关文章

相似问题

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