Commit b175f97c authored by Peter Mrekaj's avatar Peter Mrekaj Committed by GitHub

Fix OpenAPI specification inconsistencies (#1614)

Several inconsistencies declared in the pins and stamps endpoints
of the OpenAPI specification and the bee API server implementation
are removed. On top of that also fixes several declaration errors.
parent 631c8d8a
......@@ -129,7 +129,7 @@ jobs:
timeout 10m ./beeinfra.sh install --local -r "${REPLICA}" --geth --k3s --pay-threshold 1000000000000 --postage --db-capacity 100
- name: Test gc
id: gc-chunk-1
run: ./beekeeper check gc --db-capacity 100 --reserve --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --wait 15s
run: ./beekeeper check gc --cache-capacity 100 --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
- name: Destroy the cluster
run: |
./beeinfra.sh uninstall
......
......@@ -19,7 +19,7 @@ servers:
default: "localhost"
description: Base address of the local bee node main API
port:
default: 1633
default: "1633"
description: Service port provided in bee node config
- url: "http://{apiRoot}:{port}"
variables:
......@@ -27,7 +27,7 @@ servers:
default: "localhost"
description: Base address of the local bee node main API
port:
default: 1633
default: "1633"
description: Service port provided in bee node config
paths:
......@@ -445,7 +445,7 @@ paths:
- in: path
name: address
schema:
$ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress"
$ref: "SwarmCommon.yaml#/components/schemas/SwarmOnlyReference"
required: true
description: Swarm address of the root hash
post:
......@@ -463,8 +463,8 @@ paths:
$ref: "SwarmCommon.yaml#/components/responses/400"
"403":
$ref: "SwarmCommon.yaml#/components/responses/403"
"404":
$ref: "SwarmCommon.yaml#/components/responses/404"
"500":
$ref: "SwarmCommon.yaml#/components/responses/500"
default:
description: Default response
delete:
......@@ -482,8 +482,8 @@ paths:
$ref: "SwarmCommon.yaml#/components/responses/400"
"403":
$ref: "SwarmCommon.yaml#/components/responses/403"
"404":
$ref: "SwarmCommon.yaml#/components/responses/404"
"500":
$ref: "SwarmCommon.yaml#/components/responses/500"
default:
description: Default response
get:
......@@ -496,9 +496,13 @@ paths:
content:
application/json:
schema:
$ref: "SwarmCommon.yaml#/components/schemas/PinningState"
$ref: "SwarmCommon.yaml#/components/schemas/SwarmOnlyReference"
"400":
$ref: "SwarmCommon.yaml#/components/responses/400"
"403":
$ref: "SwarmCommon.yaml#/components/responses/403"
"404":
$ref: "SwarmCommon.yaml#/components/responses/404"
"500":
$ref: "SwarmCommon.yaml#/components/responses/500"
default:
......@@ -515,7 +519,7 @@ paths:
content:
application/json:
schema:
$ref: "SwarmCommon.yaml#/components/schemas/BzzChunksPinned"
$ref: "SwarmCommon.yaml#/components/schemas/SwarmOnlyReferencesList"
"403":
$ref: "SwarmCommon.yaml#/components/responses/403"
"500":
......@@ -725,6 +729,13 @@ paths:
description: Default response
"/stamps/{id}":
parameters:
- in: path
name: id
schema:
$ref: "SwarmCommon.yaml#/components/schemas/BatchID"
required: true
description: Swarm address of the stamp
get:
summary: Get an individual postage batch status
tags:
......@@ -735,7 +746,7 @@ paths:
content:
application/json:
schema:
$ref: "SwarmCommon.yaml#/components/schemas/PostageBatchResponse"
$ref: "SwarmCommon.yaml#/components/schemas/PostageBatch"
"400":
$ref: "SwarmCommon.yaml#/components/responses/400"
default:
......@@ -749,17 +760,20 @@ paths:
parameters:
- in: path
name: amount
type: integer
schema:
type: integer
required: true
description: Amount added to the balance
- in: path
name: depth
type: integer
schema:
type: integer
required: true
description: Batch depth. Must be higher than default bucket depth (16)
- in: query
name: label
type: string
schema:
type: string
required: false
description: An optional label for this batch
responses:
......@@ -773,6 +787,6 @@ paths:
$ref: "SwarmCommon.yaml#/components/responses/400"
"500":
$ref: "SwarmCommon.yaml#/components/responses/500"
default:
default:
description: Default response
......@@ -237,14 +237,6 @@ components:
items:
$ref: "#/components/schemas/Address"
PinningState:
type: object
properties:
address:
$ref: "#/components/schemas/SwarmAddress"
pinCounter:
type: integer
PssRecipient:
type: string
......@@ -263,11 +255,6 @@ components:
reference:
$ref: "#/components/schemas/SwarmReference"
PostageBatchResponse:
type: object
properties:
$ref: "#/components/schemas/PostageBatch"
PostageBatchesResponse:
type: object
properties:
......@@ -278,7 +265,7 @@ components:
type: object
properties:
batchID:
$ref: "#/components/schemas/SwarmAddress"
$ref: "#/components/schemas/BatchID"
Response:
type: object
......@@ -304,7 +291,7 @@ components:
type: object
properties:
batchID:
$ref: "#/components/schemas/SwarmAddress"
$ref: "#/components/schemas/BatchID"
utilization:
type: integer
......@@ -356,11 +343,23 @@ components:
pattern: '^[A-Za-z0-9]+\.[A-Za-z0-9]+$'
example: "swarm.eth"
BatchID:
pattern: "^[A-Fa-f0-9]{64}$"
example: "36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f"
SwarmOnlyReference:
oneOf:
- $ref: "#/components/schemas/SwarmAddress"
- $ref: "#/components/schemas/SwarmEncryptedReference"
SwarmOnlyReferencesList:
type: object
properties:
addresses:
type: array
items:
$ref: "#/components/schemas/SwarmOnlyReference"
SwarmReference:
oneOf:
- $ref: "#/components/schemas/SwarmAddress"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment