mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: add /api prefix to chat swagger annotations (#25051)
Fixes API endpoints in exp_chats.go to ensure the API endpoints show up
correctly.
> 🤖
This commit is contained in:
Generated
+665
-665
File diff suppressed because it is too large
Load Diff
Generated
+593
-593
File diff suppressed because it is too large
Load Diff
+18
-18
@@ -168,7 +168,7 @@ func publishChatConfigEvent(logger slog.Logger, ps dbpubsub.Pubsub, kind pubsub.
|
||||
// @Tags Chats
|
||||
// @Produce json
|
||||
// @Success 200 {object} codersdk.ChatWatchEvent
|
||||
// @Router /experimental/chats/watch [get]
|
||||
// @Router /api/experimental/chats/watch [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) watchChats(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -234,7 +234,7 @@ func (api *API) watchChats(rw http.ResponseWriter, r *http.Request) {
|
||||
// 1. move aggregation to a SQL view with proper in-query authz so we
|
||||
// can return a single row per workspace without this two-pass approach.
|
||||
// 2. Restore the below router annotation and un-skip docs gen
|
||||
// <at>Router /experimental/chats/by-workspace [post]
|
||||
// <at>Router /api/experimental/chats/by-workspace [post]
|
||||
//
|
||||
// @Summary Get latest chats by workspace IDs
|
||||
// @ID get-latest-chats-by-workspace-ids
|
||||
@@ -315,7 +315,7 @@ func (api *API) chatsByWorkspace(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Param q query string false "Search query"
|
||||
// @Param label query string false "Filter by label as key:value. Repeat for multiple (AND logic)."
|
||||
// @Success 200 {array} codersdk.Chat
|
||||
// @Router /experimental/chats [get]
|
||||
// @Router /api/experimental/chats [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) listChats(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -932,7 +932,7 @@ func (api *API) validateUserChatModelConfigAvailable(
|
||||
// @Produce json
|
||||
// @Param request body codersdk.CreateChatRequest true "Create chat request"
|
||||
// @Success 201 {object} codersdk.Chat
|
||||
// @Router /experimental/chats [post]
|
||||
// @Router /api/experimental/chats [post]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) postChats(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -1222,7 +1222,7 @@ func (api *API) postChats(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Tags Chats
|
||||
// @Produce json
|
||||
// @Success 200 {object} codersdk.ChatModelsResponse
|
||||
// @Router /experimental/chats/models [get]
|
||||
// @Router /api/experimental/chats/models [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) listChatModels(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -1920,7 +1920,7 @@ func (api *API) deleteChatUsageLimitGroupOverride(rw http.ResponseWriter, r *htt
|
||||
// @Produce json
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Success 200 {object} codersdk.Chat
|
||||
// @Router /experimental/chats/{chat} [get]
|
||||
// @Router /api/experimental/chats/{chat} [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
//
|
||||
//nolint:revive // HTTP handler writes to ResponseWriter.
|
||||
@@ -1997,7 +1997,7 @@ func (api *API) getChat(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Param after_id query int false "Return messages with id > after_id"
|
||||
// @Param limit query int false "Page size, 1 to 200. Defaults to 50."
|
||||
// @Success 200 {object} codersdk.ChatMessagesResponse
|
||||
// @Router /experimental/chats/{chat}/messages [get]
|
||||
// @Router /api/experimental/chats/{chat}/messages [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
//
|
||||
//nolint:revive // HTTP handler writes to ResponseWriter.
|
||||
@@ -2150,7 +2150,7 @@ func (api *API) authorizeChatWorkspaceExec(
|
||||
// @Produce json
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Success 200 {object} codersdk.WorkspaceAgentGitServerMessage
|
||||
// @Router /experimental/chats/{chat}/stream/git [get]
|
||||
// @Router /api/experimental/chats/{chat}/stream/git [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
//
|
||||
//nolint:revive // HTTP handler writes to ResponseWriter.
|
||||
@@ -2305,7 +2305,7 @@ proxyLoop:
|
||||
// @Produce application/octet-stream
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Success 101
|
||||
// @Router /experimental/chats/{chat}/stream/desktop [get]
|
||||
// @Router /api/experimental/chats/{chat}/stream/desktop [get]
|
||||
// @Description Raw binary WebSocket stream of the chat workspace desktop.
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
//
|
||||
@@ -2497,7 +2497,7 @@ func (api *API) applyChatTitleUpdate(
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Param request body codersdk.UpdateChatRequest true "Update chat request"
|
||||
// @Success 204
|
||||
// @Router /experimental/chats/{chat} [patch]
|
||||
// @Router /api/experimental/chats/{chat} [patch]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) patchChat(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -2807,7 +2807,7 @@ func (api *API) writeChildUnarchiveGuard(
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Param request body codersdk.CreateChatMessageRequest true "Create chat message request"
|
||||
// @Success 200 {object} codersdk.CreateChatMessageResponse
|
||||
// @Router /experimental/chats/{chat}/messages [post]
|
||||
// @Router /api/experimental/chats/{chat}/messages [post]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) postChatMessages(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -3005,7 +3005,7 @@ func (api *API) postChatMessages(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Param message path int true "Message ID"
|
||||
// @Param request body codersdk.EditChatMessageRequest true "Edit chat message request"
|
||||
// @Success 200 {object} codersdk.EditChatMessageResponse
|
||||
// @Router /experimental/chats/{chat}/messages/{message} [patch]
|
||||
// @Router /api/experimental/chats/{chat}/messages/{message} [patch]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) patchChatMessage(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -3263,7 +3263,7 @@ func (api *API) markChatAsRead(ctx context.Context, chatID uuid.UUID) {
|
||||
// @Produce json
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Success 200 {object} codersdk.ChatStreamEvent
|
||||
// @Router /experimental/chats/{chat}/stream [get]
|
||||
// @Router /api/experimental/chats/{chat}/stream [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) streamChat(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -3408,7 +3408,7 @@ func (api *API) streamChat(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Produce json
|
||||
// @Success 200 {object} codersdk.Chat
|
||||
// @Router /experimental/chats/{chat}/interrupt [post]
|
||||
// @Router /api/experimental/chats/{chat}/interrupt [post]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) interruptChat(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -3450,7 +3450,7 @@ func (api *API) interruptChat(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Produce json
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Success 200 {object} codersdk.Chat
|
||||
// @Router /experimental/chats/{chat}/title/regenerate [post]
|
||||
// @Router /api/experimental/chats/{chat}/title/regenerate [post]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
//
|
||||
//nolint:revive // HTTP handler writes to ResponseWriter.
|
||||
@@ -3568,7 +3568,7 @@ func (api *API) proposeChatTitle(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Produce json
|
||||
// @Param chat path string true "Chat ID" format(uuid)
|
||||
// @Success 200 {object} codersdk.ChatDiffContents
|
||||
// @Router /experimental/chats/{chat}/diff [get]
|
||||
// @Router /api/experimental/chats/{chat}/diff [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
//
|
||||
//nolint:revive // HTTP handler writes to ResponseWriter.
|
||||
@@ -5772,7 +5772,7 @@ func (api *API) deleteUserChatCompactionThreshold(rw http.ResponseWriter, r *htt
|
||||
// @Produce json
|
||||
// @Param organization query string true "Organization ID" format(uuid)
|
||||
// @Success 201 {object} codersdk.UploadChatFileResponse
|
||||
// @Router /experimental/chats/files [post]
|
||||
// @Router /api/experimental/chats/files [post]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) postChatFile(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -5911,7 +5911,7 @@ func (api *API) postChatFile(rw http.ResponseWriter, r *http.Request) {
|
||||
// @Produce image/png,image/jpeg,image/gif,image/webp,text/plain,text/markdown,text/csv,application/json,application/pdf
|
||||
// @Param file path string true "File ID" format(uuid)
|
||||
// @Success 200
|
||||
// @Router /experimental/chats/files/{file} [get]
|
||||
// @Router /api/experimental/chats/files/{file} [get]
|
||||
// @Description Experimental: this endpoint is subject to change.
|
||||
func (api *API) chatFileByID(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
Reference in New Issue
Block a user