在 go/goa 框架中弃用端点的正确方法是什么,例如:
a.Action("foo", func() {
a.Routing(
a.PATCH("/foo"),
)
a.Description("Test endpoint")
a.Response(d.OK, func() {
a.Media(someTestMediaType)
})
a.Response(d.Accepted, func() {
a.Media(someTestMediaType)
})
a.Response(d.BadRequest, JSONAPIErrors)
a.Response(d.InternalServerError, JSONAPIErrors)
})
在 java/spring 世界中,我只需在 Controller 方法上添加 @Deprecated
注释,如果 swagger 就位,它也会标记它已被弃用,以便这会在代码和 UI 中反射(reflect)出来:
想知道 go/goa 相当于什么?
最佳答案
关于go - 如何在 go/goa 框架中正确弃用 API 端点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48764572/