diff options
| author | 2025-11-11 19:39:09 +0100 | |
|---|---|---|
| committer | 2025-11-17 14:15:04 +0100 | |
| commit | 0c7b069c4a09f01a3a6c59bd7b66f096f8dcec40 (patch) | |
| tree | e5306d5ebad1e5a6efe5393bfafde95f5b94b237 /internal/api/client/streaming/stream.go | |
| parent | [performance] remove hard reliance on .Cached field to indicate whether media... (diff) | |
| download | gotosocial-0c7b069c4a09f01a3a6c59bd7b66f096f8dcec40.tar.xz | |
[chore] Apply schema for OpenAPI errors (#4511)
Adds an error struct to Swagger covering normal and OAuth errors for client API endpoints. Now clients using Swagger codegen can handle errors.
Specifically, if you _don't_ have typed errors in your Swagger IDL and you're using `go-swagger` to generate your API client, the error message is discarded and you are only told the status code. With this change in place, clients like `slurp` can tell the user that they tried to upload an emoji that was too big or whatever.
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4511
Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org>
Co-authored-by: Vyr Cossont <vyr@noreply.codeberg.org>
Co-committed-by: Vyr Cossont <vyr@noreply.codeberg.org>
Diffstat (limited to 'internal/api/client/streaming/stream.go')
| -rw-r--r-- | internal/api/client/streaming/stream.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/api/client/streaming/stream.go b/internal/api/client/streaming/stream.go index 5d7f17f94..7af540651 100644 --- a/internal/api/client/streaming/stream.go +++ b/internal/api/client/streaming/stream.go @@ -149,8 +149,12 @@ var pingMsg = []byte("ping!") // type: string // example: "{\"id\":\"01FC3TZ5CFG6H65GCKCJRKA669\",\"created_at\":\"2021-08-02T16:25:52Z\",\"sensitive\":false,\"spoiler_text\":\"\",\"visibility\":\"public\",\"language\":\"en\",\"uri\":\"https://gts.superseriousbusiness.org/users/dumpsterqueer/statuses/01FC3TZ5CFG6H65GCKCJRKA669\",\"url\":\"https://gts.superseriousbusiness.org/@dumpsterqueer/statuses/01FC3TZ5CFG6H65GCKCJRKA669\",\"replies_count\":0,\"reblogs_count\":0,\"favourites_count\":0,\"favourited\":false,\"reblogged\":false,\"muted\":false,\"bookmarked\":fals…//gts.superseriousbusiness.org/fileserver/01JNN207W98SGG3CBJ76R5MVDN/header/original/019036W043D8FXPJKSKCX7G965.png\",\"header_static\":\"https://gts.superseriousbusiness.org/fileserver/01JNN207W98SGG3CBJ76R5MVDN/header/small/019036W043D8FXPJKSKCX7G965.png\",\"followers_count\":33,\"following_count\":28,\"statuses_count\":126,\"last_status_at\":\"2021-08-02T16:25:52Z\",\"emojis\":[],\"fields\":[]},\"media_attachments\":[],\"mentions\":[],\"tags\":[],\"emojis\":[],\"card\":null,\"poll\":null,\"text\":\"a\"}" // '401': +// schema: +// "$ref": "#/definitions/error" // description: unauthorized // '400': +// schema: +// "$ref": "#/definitions/error" // description: bad request func (m *Module) StreamGETHandler(c *gin.Context) { var ( |
