我被要求将 HATEOAS 作为我们其余 API 的一部分来实现,这就是 Swagger 规范中定义响应的方式
_links:
[
{
rel:
string
The relationship to the request e.g. self which contains the resource that was requested or {object name}, a link to a resource that is related to the requested resource
action:
[
{
httpVerb:
string
Allowed actions for this link based on the users permissions
Enum:
Array[4]
0:"GET"
1:"POST"
2:"PUT"
3:"DELETE"
}
]
href:
string
A fully qualified URL to the resource.
}
]
rel和href是有道理的,我可以找到这两个的很多例子,但我找不到任何动作。它是标准的一部分吗?我真的应该寄回去吗?
我正在使用 Spring hateoas 库,并且它肯定不支持操作。对此的任何指导都将是可观的。
谢谢。