2015-05-14 11 views
8

Ho la struttura di dati definiti come segue:Come mostrare nidificato Attributo Definizione In 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. 

sto cercando di utilizzare questa struttura dati in un'altra definizione intraprendere le seguenti azioni:

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

Quello che voglio succedere è per Apiary.io Documentation per mostrare la definizione di non solo gli attributi di livello superiore ma anche quelli dell'oggetto PlayerRank. Come sviluppatore che cerca di capire l'interfaccia utente, voglio vedere la definizione di ogni oggetto e campo in modo da sapere come formulare correttamente una richiesta. In questo momento fornisce solo la descrizione dell'oggetto PlayerRanks che è: "Una raccolta di oggetti PlayerRank che specificano il grado di gioco e i punti segnati per ciascun giocatore." ma non espande la definizione per mostrare tutte le proprietà di una struttura di dati PlayerRank.

Qualche idea se la documentazione di Apiary.io può facilitare questo?

risposta

4

ora apiario, API supporta Blueprint oggetti nidificati che è possibile definire come di seguito per esempio

+ 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 è una funzione beta e l'interfaccia utente non è ancora finita, vedere this github issue per ulteriori informazioni e un'anteprima del futuro di birght.

Problemi correlati