Skip to content

Commit

Permalink
fix: add missing openapi spec (#4598)
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol authored Feb 29, 2024
1 parent a4fa9b8 commit 4dd8371
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
38 changes: 38 additions & 0 deletions openapi/Swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,44 @@ paths:
default:
description: Default response

"/rchash/{depth}/{anchor1}/{anchor2}":
get:
summary: Get reserve commitment hash with sample proofs
tags:
- RChash
parameters:
- in: path
name: depth
schema:
type: integer
minimum: 0
default: 0
required: true
description: The storage depth.
- in: path
name: anchor1
schema:
$ref: "#/components/schemas/HexString"
required: true
description: The first anchor.
- in: path
name: anchor2
schema:
$ref: "#/components/schemas/HexString"
required: true
description: The second anchor.
responses:
"200":
description: Reserve sample response
content:
application/json:
schema:
$ref: "SwarmCommon.yaml#/components/schemas/ApiRCHashResponse"
"500":
$ref: "SwarmCommon.yaml#/components/responses/500"
default:
description: Default response

components:
securitySchemes:
basicAuth:
Expand Down
77 changes: 77 additions & 0 deletions openapi/SwarmCommon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,83 @@ components:
items:
$ref: "#/components/schemas/StatusSnapshotResponse"

ApiChunkInclusionProof:
type: object
properties:
chunkSpan:
minimum: 0
type: integer
postageProof:
$ref: '#/components/schemas/ApiPostageProof'
proofSegments:
items:
type: string
nullable: true
type: array
proofSegments2:
items:
type: string
nullable: true
type: array
proofSegments3:
items:
type: string
nullable: true
type: array
proveSegment:
type: string
proveSegment2:
type: string
socProof:
items:
$ref: '#/components/schemas/ApiSOCProof'
nullable: true
type: array

ApiChunkInclusionProofs:
type: object
properties:
proof1:
$ref: '#/components/schemas/ApiChunkInclusionProof'
proof2:
$ref: '#/components/schemas/ApiChunkInclusionProof'
proofLast:
$ref: '#/components/schemas/ApiChunkInclusionProof'

ApiPostageProof:
type: object
properties:
index:
type: string
postageId:
type: string
signature:
type: string
timeStamp:
type: string

ApiRCHashResponse:
type: object
properties:
duration:
type: integer
hash:
$ref: '#/components/schemas/SwarmAddress'
proofs:
$ref: '#/components/schemas/ApiChunkInclusionProofs'

ApiSOCProof:
type: object
properties:
chunkAddr:
type: string
identifier:
type: string
signature:
type: string
signer:
type: string

headers:
SwarmTag:
description: "Tag UID"
Expand Down

0 comments on commit 4dd8371

Please sign in to comment.