From 70a694ed4ce819eb319aff0a38ad013e6bcbd3dc Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Tue, 6 Aug 2024 11:00:49 +0400 Subject: [PATCH] fix: document files API needs ustar format (#14152) Signed-off-by: Spike Curtis --- coderd/apidoc/docs.go | 2 +- coderd/apidoc/swagger.json | 2 +- coderd/files.go | 2 +- docs/api/files.md | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 3293c305ab..a446420fc3 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -988,7 +988,7 @@ const docTemplate = `{ }, { "type": "file", - "description": "File to be uploaded", + "description": "File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems).", "name": "file", "in": "formData", "required": true diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index d7fa6b9ea6..af6106bf23 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -848,7 +848,7 @@ }, { "type": "file", - "description": "File to be uploaded", + "description": "File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems).", "name": "file", "in": "formData", "required": true diff --git a/coderd/files.go b/coderd/files.go index 9a43617fe8..d16a3447a1 100644 --- a/coderd/files.go +++ b/coderd/files.go @@ -38,7 +38,7 @@ const ( // @Accept application/x-tar // @Tags Files // @Param Content-Type header string true "Content-Type must be `application/x-tar` or `application/zip`" default(application/x-tar) -// @Param file formData file true "File to be uploaded" +// @Param file formData file true "File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems)." // @Success 201 {object} codersdk.UploadResponse // @Router /files [post] func (api *API) postFile(rw http.ResponseWriter, r *http.Request) { diff --git a/docs/api/files.md b/docs/api/files.md index 936be96cc5..379f59bf57 100644 --- a/docs/api/files.md +++ b/docs/api/files.md @@ -22,11 +22,11 @@ file: string ### Parameters -| Name | In | Type | Required | Description | -| -------------- | ------ | ------ | -------- | ------------------------------------------------------------- | -| `Content-Type` | header | string | true | Content-Type must be `application/x-tar` or `application/zip` | -| `body` | body | object | true | | -| `» file` | body | binary | true | File to be uploaded | +| Name | In | Type | Required | Description | +| -------------- | ------ | ------ | -------- | ---------------------------------------------------------------------------------------------- | +| `Content-Type` | header | string | true | Content-Type must be `application/x-tar` or `application/zip` | +| `body` | body | object | true | | +| `» file` | body | binary | true | File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems). | ### Example responses