2015-05-14 11 views
8

Mam struktury danych zdefiniowane następująco:Jak pokazać zagnieżdżony Atrybut Definicja W Apiary.io

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

Ja próbuje użyć tej struktury danych w innej definicji działania w następujący sposób:

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

To, co chcę zrobić, to dokumentacja Apiary.io, która pokazuje definicję nie tylko atrybutów najwyższego poziomu, ale także obiektów PlayerRank. Jako programista starający się zrozumieć interfejs użytkownika, chcę zobaczyć definicję każdego obiektu i pola, dzięki czemu wiem, jak prawidłowo utworzyć żądanie. W tej chwili jest tylko opis obiektu playerRanks, który jest: "zbiorem obiektów PlayerRank określających rangę gry i zdobyte punkty dla każdego gracza." ale nie rozszerza definicji, aby pokazać wszystkie właściwości struktury danych PlayerRank.

Każdy pomysł, czy dokumentacja Apiary.io może to ułatwić?

Odpowiedz

4

teraz Pasieka, Blueprint API obsługuje zagnieżdżone obiekty, które można zdefiniować jako poniżej przykładowo

+ 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 
2

AFAIK to funkcja beta, a interfejs użytkownika jeszcze się nie zakończył, patrz this github issue, aby uzyskać więcej informacji i zapoznać się z przyszłością birght.

Powiązane problemy