summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-12-11 17:50:00 +0100
committerLibravatar GitHub <noreply@github.com>2021-12-11 17:50:00 +0100
commite2daf0f012a21928ceeba03e5754b5a2233f4016 (patch)
treee94cac357b3a2cc63db9adcb730ce3053bf0b970 /internal/api/model
parentImplement Cobra CLI tooling, Viper config tooling (#336) (diff)
downloadgotosocial-e2daf0f012a21928ceeba03e5754b5a2233f4016.tar.xz
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
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/well-known.go10
1 files changed, 9 insertions, 1 deletions
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"`
}