Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing openapi spec #4598

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading