Skip to content

Commit

Permalink
docs: update openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
nugaon committed Jul 1, 2024
1 parent f2cc8d8 commit f4c117f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
48 changes: 45 additions & 3 deletions openapi/Swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -743,12 +743,12 @@ paths:
$ref: "SwarmCommon.yaml#/components/schemas/HexString"
required: true
description: Signature
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPinParameter"
- in: header
schema:
$ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId"
name: swarm-postage-batch-id
required: true
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPinParameter"
requestBody:
required: true
description: The SOC binary data is composed of the span (8 bytes) and the at most 4KB payload.
Expand All @@ -774,6 +774,47 @@ paths:
$ref: "SwarmCommon.yaml#/components/responses/500"
default:
description: Default response
get:
summary: Resolve Single Owner Chunk data
tags:
- Single owner chunk
parameters:
- in: path
name: owner
schema:
$ref: "SwarmCommon.yaml#/components/schemas/EthereumAddress"
required: true
description: Ethereum address of the Owner of the SOC
- in: path
name: id
schema:
$ref: "SwarmCommon.yaml#/components/schemas/HexString"
required: true
description: Arbitrary identifier of the related data
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmOnlyRootChunkParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmCache"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter"
responses:
"200":
description: Related Single Owner Chunk data
headers:
"swarm-soc-signature":
$ref: "SwarmCommon.yaml#/components/headers/SwarmSocSignature"
content:
application/octet-stream:
schema:
type: string
format: binary
"400":
$ref: "SwarmCommon.yaml#/components/responses/400"
"401":
$ref: "SwarmCommon.yaml#/components/responses/401"
"500":
$ref: "SwarmCommon.yaml#/components/responses/500"
default:
description: Default response

"/feeds/{owner}/{topic}":
post:
Expand Down Expand Up @@ -853,6 +894,7 @@ paths:
$ref: "SwarmCommon.yaml#/components/schemas/FeedType"
required: false
description: "Feed indexing scheme (default: sequence)"
- $ref: "SwarmCommon.yaml#/components/headers/SwarmOnlyRootChunkParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmCache"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
Expand All @@ -861,12 +903,12 @@ paths:
"200":
description: Latest feed update
headers:
"swarm-soc-signature":
$ref: "SwarmCommon.yaml#/components/headers/SwarmSocSignature"
"swarm-feed-index":
$ref: "SwarmCommon.yaml#/components/headers/SwarmFeedIndex"
"swarm-feed-index-next":
$ref: "SwarmCommon.yaml#/components/headers/SwarmFeedIndexNext"
"swarm-only-root-chunk":
$ref: "SwarmCommon.yaml#/components/headers/SwarmOnlyRootChunk"
content:
application/octet-stream:
schema:
Expand Down
14 changes: 11 additions & 3 deletions openapi/SwarmCommon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -977,10 +977,10 @@ components:
schema:
$ref: "#/components/schemas/HexString"

SwarmOnlyRootChunk:
description: "Returns only the root chunk of the content"
SwarmSocSignature:
description: "Attached digital signature of the Single Owner Chunk"
schema:
type: boolean
$ref: "#/components/schemas/HexString"

ETag:
description: |
Expand Down Expand Up @@ -1081,6 +1081,14 @@ components:
required: false
description: >
Specify the timeout for chunk retrieval. The default is 30 seconds.
SwarmOnlyRootChunkParameter:
in: header
name: swarm-only-root-chunk
schema:
type: boolean
required: false
description: "Returns only the root chunk of the content"

ContentTypePreserved:
in: header
Expand Down

0 comments on commit f4c117f

Please sign in to comment.