Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Show Nested Attribute Definition In Apiary.io

I have a data structure defined as follows:

# 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.

I'm attempting to use this data structure in another action definition as follows:

## 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.

What I want to happen is for the Apiary.io Documentation to show the definition of not only the top level attributes but also those of the PlayerRank object. As a developer trying to understand the UI, I want to see the definition of each object and field so I know how to properly form a request. Right now it only gives the description for the playerRanks object which is : "A collection of PlayerRank objects specifying the game rank and points scored for each Player." but it doesn't expand the definition to show all of the properties of a PlayerRank data structure.

Any idea if the Apiary.io documentation can facilitate this?

like image 890
jakejgordon Avatar asked May 14 '15 11:05

jakejgordon


1 Answers

now Apiary, API Blueprint supports nested objects which you can define as below for example

+ 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
like image 87
Buddhi Avatar answered Oct 11 '22 17:10

Buddhi