2016-08-26 24 views

答えて

2

空白の配列がちょうど状態..ですJSONコード

{  
    "status":0, 
    "gtasks":[], 
    "purchased":[], 
    "scnt":0  
} 

すべてのヘルプははるかに高く評価されるだろう、次からの応答部分のYAMLコードをしたいです。しかし、アイテムがあれば、配列はアイテムでいっぱいになります。その場合、それらの配列内に何が存在するかについての定義を提供する必要があります。

{  
    "status":0, 
    "gtasks":[], 
    "purchased":[], 
    "scnt":0  
} 

データ型または他のスキーマ・オブジェクトのいずれかと配列型を充填するコメントを見る:

ここ表すYourObjectNameのスキーマ定義です。ヘルプが必要な場合は

definitions: 

    YourObjectName: 
    type: object 
    required: 
     - status 
    properties: 
     status: 
     type: integer 
     format: int32 # you need 
     gtasks: 
     type: array 
     items: # Need to define item type, could be any data type of object 
      type: string 
     purchased: 
     type: array 
     items: 
      type: string # For reference to different schema object use $ref: "#/definitions/PurchasedItems" 
     scnt: 
     type: integer 
     format: int32 

最後に、http://editor.swagger.io/

幸運から "PetStoreを" 例のAPI仕様を参照してください。