From 48711570af177c2a2857e336b6361b3872bf4831 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 9 Aug 2023 14:54:29 +0200 Subject: [PATCH] Document API endpoint metadata --- api/endpoints.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/endpoints.go b/api/endpoints.go index c60a602..1c34d30 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -23,6 +23,13 @@ import ( // Path and at least one permission are required. // As is exactly one function. type Endpoint struct { //nolint:maligned + // Name is the human reabable name of the endpoint. + Name string + // Description is the human readable description and documentation of the endpoint. + Description string + // Parameters is the parameter documentation. + Parameters []Parameter `json:",omitempty"` + // Path describes the URL path of the endpoint. Path string @@ -74,12 +81,6 @@ type Endpoint struct { //nolint:maligned // HandlerFunc is the raw http handler. HandlerFunc http.HandlerFunc `json:"-"` - - // Documentation Metadata. - - Name string - Description string - Parameters []Parameter `json:",omitempty"` } // Parameter describes a parameterized variation of an endpoint.