Skip to content

Commit

Permalink
docs(act): rebase to openapi after api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aranyia committed Jun 7, 2024
1 parent 34942c5 commit 50604e1
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
36 changes: 36 additions & 0 deletions openapi/Swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ paths:
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
responses:
"200":
description: Retrieved content specified by reference
Expand All @@ -132,6 +135,9 @@ paths:
$ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress"
required: true
description: Swarm address of chunk
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
responses:
"200":
description: Chunk exists
Expand All @@ -150,6 +156,8 @@ paths:
parameters:
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmTagParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmAct"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
requestBody:
description: Chunk binary data that has to have at least 8 bytes.
content:
Expand All @@ -165,6 +173,8 @@ paths:
description: Tag UID if it was passed to the request `swarm-tag` header.
schema:
$ref: "SwarmCommon.yaml#/components/schemas/Uid"
"swarm-act-history-address":
$ref: "SwarmCommon.yaml#/components/headers/SwarmActHistoryAddress"
content:
application/json:
schema:
Expand Down Expand Up @@ -221,6 +231,8 @@ paths:
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmDeferredUpload"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyLevelParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmAct"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
requestBody:
content:
multipart/form-data:
Expand All @@ -247,6 +259,8 @@ paths:
$ref: "SwarmCommon.yaml#/components/headers/SwarmTag"
"etag":
$ref: "SwarmCommon.yaml#/components/headers/ETag"
"swarm-act-history-address":
$ref: "SwarmCommon.yaml#/components/headers/SwarmActHistoryAddress"
content:
application/json:
schema:
Expand Down Expand Up @@ -276,6 +290,9 @@ paths:
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
responses:
"200":
description: Ok
Expand Down Expand Up @@ -305,6 +322,9 @@ paths:
$ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress"
required: true
description: Swarm address of chunk
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
responses:
"200":
description: Chunk exists
Expand Down Expand Up @@ -691,6 +711,8 @@ paths:
$ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId"
name: swarm-postage-batch-id
required: true
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmAct"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
requestBody:
required: true
description: The SOC binary data is composed of the span (8 bytes) and the at most 4KB payload.
Expand All @@ -706,6 +728,9 @@ paths:
application/json:
schema:
$ref: "SwarmCommon.yaml#/components/schemas/ReferenceResponse"
headers:
"swarm-act-history-address":
$ref: "SwarmCommon.yaml#/components/headers/SwarmActHistoryAddress"
"400":
$ref: "SwarmCommon.yaml#/components/responses/400"
"401":
Expand Down Expand Up @@ -743,13 +768,18 @@ paths:
description: "Feed indexing scheme (default: sequence)"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPinParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmAct"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: "SwarmCommon.yaml#/components/schemas/ReferenceResponse"
headers:
"swarm-act-history-address":
$ref: "SwarmCommon.yaml#/components/headers/SwarmActHistoryAddress"
"400":
$ref: "SwarmCommon.yaml#/components/responses/400"
"401":
Expand Down Expand Up @@ -1084,6 +1114,9 @@ paths:
$ref: "SwarmCommon.yaml#/components/parameters/SwarmCache"
name: swarm-cache
required: false
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
responses:
"200":
description: Retrieved chunk content
Expand Down Expand Up @@ -1111,6 +1144,9 @@ paths:
$ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress"
required: true
description: Swarm address of chunk
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
responses:
"200":
description: Chunk exists
Expand Down
70 changes: 70 additions & 0 deletions openapi/SwarmCommon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,36 @@ components:
ghostBalance:
$ref: "#/components/schemas/BigInt"

ActGranteesCreateRequest:
type: object
properties:
grantees:
type: array
items:
$ref: "#/components/schemas/PublicKey"

ActGranteesPatchRequest:
type: object
properties:
add:
type: array
items:
$ref: "#/components/schemas/PublicKey"
description: List of grantees to add
revoke:
type: array
items:
$ref: "#/components/schemas/PublicKey"
description: List of grantees to revoke future access from

ActGranteesOperationResponse:
type: object
properties:
ref:
$ref: "#/components/schemas/SwarmEncryptedReference"
historyref:
$ref: "#/components/schemas/SwarmEncryptedReference"

Balance:
type: object
properties:
Expand Down Expand Up @@ -973,6 +1003,12 @@ components:
schema:
$ref: "#/components/schemas/HexString"

SwarmActHistoryAddress:
description: "Swarm address reference to the new ACT history entry"
schema:
$ref: "#/components/schemas/SwarmAddress"
required: false

ETag:
description: |
The RFC7232 ETag header field in a response provides the current entity-
Expand Down Expand Up @@ -1133,6 +1169,40 @@ components:
required: false
description: "Determines if the download data should be cached on the node. By default the download will be cached"

SwarmAct:
in: header
name: swarm-act
schema:
type: boolean
default: "false"
required: false
description: "Determines if the uploaded data should be treated as ACT content"

SwarmActPublisher:
in: header
name: swarm-act-publisher
schema:
$ref: "#/components/schemas/PublicKey"
required: false
description: "ACT content publisher's public key"

SwarmActHistoryAddress:
in: header
name: swarm-act-history-address
schema:
$ref: "#/components/schemas/SwarmAddress"
required: false
description: "ACT history reference address"

SwarmActTimestamp:
in: header
name: swarm-act-timestamp
schema:
type: integer
format: int64
required: false
description: "ACT history Unix timestamp"

responses:
"200":
description: OK.
Expand Down

0 comments on commit 50604e1

Please sign in to comment.