Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix committed Feb 18, 2025
1 parent d284aa1 commit 5226cb8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions disperser/dataapi/docs/v2/V2_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const docTemplateV2 = `{
"parameters": [
{
"type": "string",
"description": "Direction to fetch: 'forward' or 'backward' [default: forward]",
"description": "Direction to fetch: 'forward' (oldest to newest) or 'backward' (newest to oldest) [default: forward]",
"name": "direction",
"in": "query",
"required": true
Expand All @@ -143,19 +143,19 @@ const docTemplateV2 = `{
},
{
"type": "string",
"description": "Fetch blobs after this time, exclusive (ISO 8601 format, example: 2006-01-02T15:04:05Z); must be smaller than 'before' [default: before-1h]",
"description": "Fetch blobs after this time, exclusive (ISO 8601 format, example: 2006-01-02T15:04:05Z); must be smaller than ` + "`" + `before` + "`" + ` [default: before-1h]",
"name": "after",
"in": "query"
},
{
"type": "string",
"description": "Pagination cursor; for 'forward', fetches blobs from 'cursor' to 'before', for 'backward', fetches from 'after' to 'cursor' (all are exclusive) [default: empty]",
"description": "Pagination cursor; for 'forward' direction, overides ` + "`" + `after` + "`" + ` and fetches blobs from ` + "`" + `cursor` + "`" + ` to ` + "`" + `before` + "`" + `; for 'backward' direction, overrides ` + "`" + `before` + "`" + ` and fetches blobs from ` + "`" + `cursor` + "`" + ` to ` + "`" + `before` + "`" + ` (all are exclusive) [default: empty]",
"name": "cursor",
"in": "query"
},
{
"type": "integer",
"description": "Maximum number of blobs to fetch [default: 20; max: 1000]",
"description": "Maximum number of blobs to return; if limit \u003c=0 or \u003e 1000, it's set to 1000 [default: 20; max: 1000]",
"name": "limit",
"in": "query"
}
Expand Down
8 changes: 4 additions & 4 deletions disperser/dataapi/docs/v2/V2_swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"parameters": [
{
"type": "string",
"description": "Direction to fetch: 'forward' or 'backward' [default: forward]",
"description": "Direction to fetch: 'forward' (oldest to newest) or 'backward' (newest to oldest) [default: forward]",
"name": "direction",
"in": "query",
"required": true
Expand All @@ -140,19 +140,19 @@
},
{
"type": "string",
"description": "Fetch blobs after this time, exclusive (ISO 8601 format, example: 2006-01-02T15:04:05Z); must be smaller than 'before' [default: before-1h]",
"description": "Fetch blobs after this time, exclusive (ISO 8601 format, example: 2006-01-02T15:04:05Z); must be smaller than `before` [default: before-1h]",
"name": "after",
"in": "query"
},
{
"type": "string",
"description": "Pagination cursor; for 'forward', fetches blobs from 'cursor' to 'before', for 'backward', fetches from 'after' to 'cursor' (all are exclusive) [default: empty]",
"description": "Pagination cursor; for 'forward' direction, overides `after` and fetches blobs from `cursor` to `before`; for 'backward' direction, overrides `before` and fetches blobs from `cursor` to `before` (all are exclusive) [default: empty]",
"name": "cursor",
"in": "query"
},
{
"type": "integer",
"description": "Maximum number of blobs to fetch [default: 20; max: 1000]",
"description": "Maximum number of blobs to return; if limit \u003c=0 or \u003e 1000, it's set to 1000 [default: 20; max: 1000]",
"name": "limit",
"in": "query"
}
Expand Down
15 changes: 9 additions & 6 deletions disperser/dataapi/docs/v2/V2_swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,8 @@ paths:
/blobs/feed:
get:
parameters:
- description: 'Direction to fetch: ''forward'' or ''backward'' [default: forward]'
- description: 'Direction to fetch: ''forward'' (oldest to newest) or ''backward''
(newest to oldest) [default: forward]'
in: query
name: direction
required: true
Expand All @@ -686,17 +687,19 @@ paths:
name: before
type: string
- description: 'Fetch blobs after this time, exclusive (ISO 8601 format, example:
2006-01-02T15:04:05Z); must be smaller than ''before'' [default: before-1h]'
2006-01-02T15:04:05Z); must be smaller than `before` [default: before-1h]'
in: query
name: after
type: string
- description: 'Pagination cursor; for ''forward'', fetches blobs from ''cursor''
to ''before'', for ''backward'', fetches from ''after'' to ''cursor'' (all
are exclusive) [default: empty]'
- description: 'Pagination cursor; for ''forward'' direction, overides `after`
and fetches blobs from `cursor` to `before`; for ''backward'' direction,
overrides `before` and fetches blobs from `cursor` to `before` (all are
exclusive) [default: empty]'
in: query
name: cursor
type: string
- description: 'Maximum number of blobs to fetch [default: 20; max: 1000]'
- description: 'Maximum number of blobs to return; if limit <=0 or > 1000, it''s
set to 1000 [default: 20; max: 1000]'
in: query
name: limit
type: integer
Expand Down
8 changes: 4 additions & 4 deletions disperser/dataapi/v2/blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
// @Summary Fetch blob feed in specified direction
// @Tags Blobs
// @Produce json
// @Param direction query string true "Direction to fetch: 'forward' or 'backward' [default: forward]"
// @Param direction query string true "Direction to fetch: 'forward' (oldest to newest) or 'backward' (newest to oldest) [default: forward]"
// @Param before query string false "Fetch blobs before this time, exclusive (ISO 8601 format, example: 2006-01-02T15:04:05Z) [default: now]"
// @Param after query string false "Fetch blobs after this time, exclusive (ISO 8601 format, example: 2006-01-02T15:04:05Z); must be smaller than 'before' [default: before-1h]"
// @Param cursor query string false "Pagination cursor; for 'forward', fetches blobs from 'cursor' to 'before', for 'backward', fetches from 'after' to 'cursor' (all are exclusive) [default: empty]"
// @Param limit query int false "Maximum number of blobs to fetch [default: 20; max: 1000]"
// @Param after query string false "Fetch blobs after this time, exclusive (ISO 8601 format, example: 2006-01-02T15:04:05Z); must be smaller than `before` [default: before-1h]"
// @Param cursor query string false "Pagination cursor; for 'forward' direction, overides `after` and fetches blobs from `cursor` to `before`; for 'backward' direction, overrides `before` and fetches blobs from `cursor` to `before` (all are exclusive) [default: empty]"
// @Param limit query int false "Maximum number of blobs to return; if limit <=0 or > 1000, it's set to 1000 [default: 20; max: 1000]"
// @Success 200 {object} BlobFeedResponse
// @Failure 400 {object} ErrorResponse "error: Bad request"
// @Failure 404 {object} ErrorResponse "error: Not found"
Expand Down

0 comments on commit 5226cb8

Please sign in to comment.