Skip to content

Commit e2a73e6

Browse files
committed
add docs make command
1 parent 1d48a48 commit e2a73e6

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,8 @@ else
188188
sed -i "s/BUF_VERSION := [0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/BUF_VERSION := $(VERSION)/g" Makefile
189189
endif
190190
endif
191+
192+
.PHONY: markdown-docs
193+
markdown-docs:
194+
swagger generate spec -o ./swagger.yaml -w ./code/go/0chain.net -m
195+
swagger generate markdown -f ./swagger.yaml --output=swagger.md

swagger.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Documentation of the blobber API.
3434
| GET | /v1/connection/create/{allocation} | [connection handler](#connection-handler) | |
3535
| GET | /v1/file/copy/{allocation} | [copyallocation](#copyallocation) | |
3636
| GET | /v1/dir/{allocation} | [createdirhandler](#createdirhandler) | |
37-
| POST | /v1/file/download/{allocation} | [download file](#download-file) | DownloadHandler is the handler to respond to download requests from clients. |
37+
| POST | /v1/file/download/{allocation} | [download file](#download-file) | |
3838
| GET | /v1/file/list/{allocation} | [list](#list) | |
3939
| GET | /v1/file/move/{allocation} | [moveallocation](#moveallocation) | |
4040
| GET | /v1/file/refs/recent/{allocation} | [recentalloc](#recentalloc) | |
@@ -297,12 +297,14 @@ Status: Internal Server Error
297297

298298
###### <span id="createdirhandler-500-schema"></span> Schema
299299

300-
### <span id="download-file"></span> DownloadHandler is the handler to respond to download requests from clients. (*downloadFile*)
300+
### <span id="download-file"></span> download file (*downloadFile*)
301301

302302
```
303303
POST /v1/file/download/{allocation}
304304
```
305305

306+
Download Handler (downloadFile)
307+
306308
#### Parameters
307309

308310
| Name | Source | Type | Go type | Separator | Required | Default | Description |
@@ -321,7 +323,7 @@ POST /v1/file/download/{allocation}
321323
| X-Path | `header` | string | `string` | || | The path of the file to download. |
322324
| X-Path-Hash | `header` | string | `string` | | | | The hash of the path of the file to download. If not provided, will be calculated from "X-Path" parameter. |
323325
| X-Read-Marker | `header` | string | `string` | | | | The read marker to use for the download (check [ReadMarker](#/responses/ReadMarker)). |
324-
| X-Verify-Download | `header` | string | `string` | | | | If set to "true", the download should be verified. If the mode is "thumbnail", |
326+
| X-Verify-Download | `header` | string | `string` | | | | If set to "true", the download should be verified. If the mode is "thumbnail",\ |
325327
| X-Version | `header` | string | `string` | | | | If its value is "v2" then both allocation_id and blobber url base are hashed and verified using X-App-Client-Signature-V2. |
326328

327329
#### All responses

swagger.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ paths:
612612
description: ""
613613
/v1/file/download/{allocation}:
614614
post:
615+
description: Download Handler (downloadFile)
615616
operationId: downloadFile
616617
parameters:
617618
- description: TxHash of the allocation in question.
@@ -665,14 +666,33 @@ paths:
665666
in: header
666667
name: X-Auth-Token
667668
type: string
669+
- description: Download mode. Either "full" for full file download, or "thumbnail" to download the thumbnail of the file
670+
in: header
671+
name: X-Mode
672+
type: string
673+
- description: If set to "true", the download should be verified. If the mode is "thumbnail",\
674+
in: header
675+
name: X-Verify-Download
676+
type: string
677+
- description: If its value is "v2" then both allocation_id and blobber url base are hashed and verified using X-App-Client-Signature-V2.
678+
in: header
679+
name: X-Version
680+
type: string
681+
- description: Digital signature of the client used to verify the request if the X-Version is not "v2"
682+
in: header
683+
name: X-App-Client-Signature
684+
type: string
685+
- description: Digital signature of the client used to verify the request if the X-Version is "v2"
686+
in: header
687+
name: X-App-Client-Signature-V2
688+
type: string
668689
responses:
669690
"200":
670-
description: FileDownloadResponse
691+
description: '| []byte'
671692
schema:
672693
$ref: '#/definitions/FileDownloadResponse'
673694
"400":
674695
description: ""
675-
summary: DownloadHandler is the handler to respond to download requests from clients.
676696
/v1/file/list/{allocation}:
677697
get:
678698
description: "ListHandler is the handler to respond to list requests from clients, \nit returns a list of files in the allocation,\nalong with the metadata of the files."

0 commit comments

Comments
 (0)