From 5fce7d8f71466ea78e5eb6ba562796bafbc34696 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Mon, 28 Feb 2022 22:54:49 +0500 Subject: [PATCH] chore: added some docs to file upload --- api/public/swagger.yaml | 3 +++ api/src/controllers/drive.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/api/public/swagger.yaml b/api/public/swagger.yaml index ff8c054..6adc771 100644 --- a/api/public/swagger.yaml +++ b/api/public/swagger.yaml @@ -663,6 +663,7 @@ paths: examples: 'Example 1': value: {status: failure, message: 'File request failed.'} + description: "It's optional to either provide `_filePath` in url as query parameter\nOr provide `filePath` in body as form field.\nBut it's required to provided else API will respond with Bad Request." summary: 'Create a file in SASjs Drive' tags: - Drive @@ -671,11 +672,13 @@ paths: bearerAuth: [] parameters: - + description: 'Location of SAS program' in: query name: _filePath required: false schema: type: string + example: /Public/somefolder/some.file.sas requestBody: required: true content: diff --git a/api/src/controllers/drive.ts b/api/src/controllers/drive.ts index a59b90f..6bbb813 100644 --- a/api/src/controllers/drive.ts +++ b/api/src/controllers/drive.ts @@ -117,7 +117,13 @@ export class DriveController { } /** + * It's optional to either provide `_filePath` in url as query parameter + * Or provide `filePath` in body as form field. + * But it's required to provided else API will respond with Bad Request. + * * @summary Create a file in SASjs Drive + * @param _filePath Location of SAS program + * @example _filePath "/Public/somefolder/some.file.sas" * */ @Example({