3
爲休息服務編寫API-Deocumentation時遇到了一個問題,我想列出所有可能作爲響應返回的值。Blueprint API顯示響應正文中Enum的所有可能值
在下面的情況下,它可能是「狀態」字段,它可能包含任何可能的枚舉值,我想總結哪些可能的狀態。
我找不到一個簡單而好的方法來用apiblueprint做到這一點。有沒有辦法顯示默認情況下摺疊的部分,並在需要其他信息時展開它們?
下面是示例代碼,我有:
## Sample [/Sample?{id}]
Get all the information for the sample
+ Parameters
+ id = `0` (Integer, optional) ... The Id of the resource to get
+ Model (application/json)
+ Body
{
"name": "Name of the Resource",
"state": "deleted"
}
### Retrieve the sample data of the system [GET]
+ Response 200
[ProviderConfiguration][]
我需要的東西,如「值」參數部分但對身體部位來形容在主體部分國家如
<collapsible>
+ state (EnumType) ... current state of the sample object
+ Values
+ `active`
+ `inactive`
+ `deleted`
</collapsible>
請注意,您也可以直接在請求或響應負載上添加註釋 - 有關詳細信息,請參閱http://stackoverflow.com/a/23769985/634940 – Zdenek