The apiary.io list resource attributes in point form. Is there a specific convention to show what data type these attributes are, or met data specifying formats?

有帮助吗?

解决方案

At the moment there is not convention for discussing resource's attributes in the API Blueprint. What comes close is planned Message-body Attributes Description.

But I feel what would be the real solution is what the concept of a future API Blueprint – Resource Blueprint proposes under semantic data definition (of a resource). Refer to the example resource blueprint.

So while none of the previous is implemented, if you are looking for a convention, I would suggest consider the one as proposed in resource blueprint e.g.:

# Resource [/resource]

## Attributes

+ ip (string) ... ipv4 or ipv6 address associated with the resource
+ some-other-attribute (number, optional, `42`) ... a number of something
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top