How To Show Nested Attribute Definition In Apiary.io
Asked Answered
L

2

9

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?

Levirate answered 14/5, 2015 at 11:59 Comment(0)
H
4

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
Herbertherbicide answered 18/10, 2016 at 8:55 Comment(0)
R
2

AFAIK it's a beta feature and the UI is not finished yet, see this github issue for more information and sneak preview of the birght future.

Rey answered 15/5, 2015 at 10:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.