mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
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
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user