From e2daf0f012a21928ceeba03e5754b5a2233f4016 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 11 Dec 2021 17:50:00 +0100 Subject: Add `Accept` header negotiation to relevant API endpoints (#337) * start centralizing negotiation logic for API * swagger document nodeinfo endpoint * go fmt * document negotiate function * use content negotiation * tidy up negotiation logic * negotiate content throughout client api * swagger * remove attachment on Content * add accept header to test requests --- internal/api/model/well-known.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'internal/api/model') diff --git a/internal/api/model/well-known.go b/internal/api/model/well-known.go index 945215e4e..49c43d278 100644 --- a/internal/api/model/well-known.go +++ b/internal/api/model/well-known.go @@ -22,6 +22,8 @@ package model // For example, it would be returned from https://example.org/.well-known/webfinger?resource=acct:some_username@example.org // // See https://webfinger.net/ +// +// swagger:model wellKnownResponse type WellKnownResponse struct { Subject string `json:"subject,omitempty"` Aliases []string `json:"aliases,omitempty"` @@ -40,8 +42,11 @@ type Link struct { // Nodeinfo represents a version 2.1 or version 2.0 nodeinfo schema. // See: https://nodeinfo.diaspora.software/schema.html +// +// swagger:model nodeinfo type Nodeinfo struct { // The schema version + // example: 2.0 Version string `json:"version"` // Metadata about server software in use. Software NodeInfoSoftware `json:"software"` @@ -50,6 +55,7 @@ type Nodeinfo struct { // The third party sites this server can connect to via their application API. Services NodeInfoServices `json:"services"` // Whether this server allows open self-registration. + // example: false OpenRegistrations bool `json:"openRegistrations"` // Usage statistics for this server. Usage NodeInfoUsage `json:"usage"` @@ -59,7 +65,9 @@ type Nodeinfo struct { // NodeInfoSoftware represents the name and version number of the software of this node. type NodeInfoSoftware struct { - Name string `json:"name"` + // example: gotosocial + Name string `json:"name"` + // example: 0.1.2 1234567 Version string `json:"version"` } -- cgit v1.2.3